fix: Address issues with touch devices and drag/drop causing crashes (#982)
This commit is contained in:
1 parent
d596ab5c3d
commit
cf40a8388c
1 file changed
+3
-2
@@ -10,10 +10,11 @@ const isTouchDevice = !!('ontouchstart' in window || navigator.maxTouchPoints);
|
|||||||
//
|
//
|
||||||
// http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
|
// http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
|
||||||
export default function viewerbaseDragDropContext(DecoratedClass) {
|
export default function viewerbaseDragDropContext(DecoratedClass) {
|
||||||
const backend = isTouchDevice ? TouchBackend({ enableMouseEvents: true }) : HTML5Backend;
|
const backend = isTouchDevice ? TouchBackend : HTML5Backend;
|
||||||
|
const opts = isTouchDevice ? { enableMouseEvents: true } : {};
|
||||||
|
|
||||||
return (props) => (
|
return (props) => (
|
||||||
<DndProvider backend={backend}>
|
<DndProvider backend={backend} opts={opts}>
|
||||||
<DecoratedClass {...props}/>
|
<DecoratedClass {...props}/>
|
||||||
</DndProvider>
|
</DndProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user