Thanks for the great lib!
It will be even better to add a section in Readme about how to use mobile-drag-drop as polyfills. I spent quite some time to find out that i need to firstly yarn add mobile-drag-drop myself and add this code to polyfills.ts:
import { polyfill } from 'mobile-drag-drop';
// optional import of scroll behaviour
import { scrollBehaviourDragImageTranslateOverride } from "mobile-drag-drop/scroll-behaviour";
polyfill( {
// use this to make use of the scroll behaviour
dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride
} );
window.addEventListener( "touchmove", function() {
// workaround to make scroll prevent work in iOS Safari > 10
} );
Thanks for the great lib! It will be even better to add a section in Readme about how to use mobile-drag-drop as polyfills. I spent quite some time to find out that i need to firstly
yarn add mobile-drag-drop
myself and add this code topolyfills.ts
: