fix incorrect react-dnd backend
This commit is contained in:
parent
70c39b9ad4
commit
74edfb0913
@ -4,6 +4,7 @@ import { DndProvider } from 'react-dnd';
|
||||
import HTML5Backend from 'react-dnd-html5-backend';
|
||||
import TouchBackend from 'react-dnd-touch-backend';
|
||||
|
||||
// TODO: this is false when it should not be :thinking:
|
||||
const isTouchDevice =
|
||||
typeof window !== `undefined` &&
|
||||
!!('ontouchstart' in window || navigator.maxTouchPoints);
|
||||
@ -17,8 +18,10 @@ const isTouchDevice =
|
||||
* http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
|
||||
*/
|
||||
function DragAndDropProvider({ children }) {
|
||||
const backend = isTouchDevice ? TouchBackend : HTML5Backend;
|
||||
const opts = isTouchDevice ? { enableMouseEvents: true } : {};
|
||||
const backend = HTML5Backend; // isTouchDevice ? TouchBackend : HTML5Backend;
|
||||
const opts = {}; // isTouchDevice ? { enableMouseEvents: true } : {};
|
||||
|
||||
console.log('using... touch backend?', isTouchDevice);
|
||||
|
||||
return (
|
||||
<DndProvider backend={backend} opts={opts}>
|
||||
|
||||
15
yarn.lock
15
yarn.lock
@ -9413,11 +9413,6 @@ file-loader@^1.1.11:
|
||||
loader-utils "^1.0.2"
|
||||
schema-utils "^0.4.5"
|
||||
|
||||
file-saver@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.2.tgz#06d6e728a9ea2df2cce2f8d9e84dfcdc338ec17a"
|
||||
integrity sha512-Wz3c3XQ5xroCxd1G8b7yL0Ehkf0TC9oYC6buPFkNnU9EnaPlifeAFCyCh+iewXTyFRcg0a6j3J7FmJsIhlhBdw==
|
||||
|
||||
file-selector@^0.1.12:
|
||||
version "0.1.12"
|
||||
resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.1.12.tgz#fe726547be219a787a9dcc640575a04a032b1fd0"
|
||||
@ -13459,16 +13454,6 @@ jszip@3.2.2:
|
||||
readable-stream "~2.3.6"
|
||||
set-immediate-shim "~1.0.1"
|
||||
|
||||
jszip@^3.2.2:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.4.0.tgz#1a69421fa5f0bb9bc222a46bca88182fba075350"
|
||||
integrity sha512-gZAOYuPl4EhPTXT0GjhI3o+ZAz3su6EhLrKUoAivcKqyqC7laS5JEv4XWZND9BgcDcF83vI85yGbDmDR6UhrIg==
|
||||
dependencies:
|
||||
lie "~3.3.0"
|
||||
pako "~1.0.2"
|
||||
readable-stream "~2.3.6"
|
||||
set-immediate-shim "~1.0.1"
|
||||
|
||||
keyv@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user