File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,18 @@ export default class DraggableCore extends React.Component {
392392 this . props . onDrag ( e , coreEvent ) ;
393393 } ;
394394
395+ onMouseDown : EventHandler = ( e ) => {
396+ dragEventFor = eventsFor . mouse ; // on touchscreen laptops we could switch back to mouse
397+
398+ return this . handleDragStart ( e ) ;
399+ } ;
400+
401+ onMouseUp : EventHandler = ( e ) => {
402+ dragEventFor = eventsFor . mouse ;
403+
404+ return this . handleDragStop ( e ) ;
405+ } ;
406+
395407 // Same as onMouseDown (start drag), but now consider this a touch device.
396408 onTouchStart : EventHandler = ( e ) => {
397409 // We're on a touch device now, so change the event handlers
@@ -415,9 +427,9 @@ export default class DraggableCore extends React.Component {
415427
416428 // Note: mouseMove handler is attached to document so it will still function
417429 // when the user drags quickly and leaves the bounds of the element.
418- onMouseDown : this . handleDragStart ,
430+ onMouseDown : this . onMouseDown ,
419431 onTouchStart : this . onTouchStart ,
420- onMouseUp : this . handleDragStop ,
432+ onMouseUp : this . onMouseUp ,
421433 onTouchEnd : this . onTouchEnd
422434 } ) ;
423435 }
You can’t perform that action at this time.
0 commit comments