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