reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
300 stars 119 forks source link

Add 'how to use mobile-drag-drop' as polyfill to README #10

Closed penghuili closed 6 years ago

penghuili commented 6 years ago

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
} );
reppners commented 6 years ago

Thanks for your feedback!

9 describes the same issue. I'll add a brief section with content like you suggested.

reppners commented 6 years ago

Updated the readme with your instructions, thanks!