File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ var drawer = React.createClass({
3333 acceptDoubleTap : React . PropTypes . bool ,
3434 acceptTap : React . PropTypes . bool ,
3535 acceptPan : React . PropTypes . bool ,
36+ tapToClose : React . PropTypes . bool ,
3637 styles : React . PropTypes . object ,
3738 onOpen : React . PropTypes . func ,
3839 onClose : React . PropTypes . func ,
@@ -58,6 +59,7 @@ var drawer = React.createClass({
5859 acceptDoubleTap : false ,
5960 acceptTap : false ,
6061 acceptPan : true ,
62+ tapToClose : false ,
6163 styles : { } ,
6264 onOpen : ( ) => { } ,
6365 onClose : ( ) => { } ,
@@ -261,10 +263,9 @@ var drawer = React.createClass({
261263 } ,
262264
263265 processTapGestures ( ) {
264- if ( this . props . acceptTap ) {
265- this . _open ? this . close ( ) : this . open ( )
266- }
267- else if ( this . props . acceptDoubleTap ) {
266+ if ( this . props . acceptTap ) this . _open ? this . close ( ) : this . open ( )
267+ if ( this . props . tapToClose && this . _open ) this . close ( )
268+ if ( this . props . acceptDoubleTap ) {
268269 var now = new Date ( ) . getTime ( )
269270 if ( now - this . _lastPress < 500 ) {
270271 this . _open ? this . close ( ) : this . open ( )
You can’t perform that action at this time.
0 commit comments