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

Drag and drop in touch screen is not working #7

Closed unnatishah96 closed 6 years ago

unnatishah96 commented 6 years ago

I am not using angular2-material. Is there any way to use this drag and drop in touch screen devices ?

reppners commented 6 years ago

For touch support use the polyfill mentioned in the README.

Angular Material is just used for the demo, there is no dependency on it for the library to work.

kikkiraj commented 5 years ago

I followed polyfill mentioned in the README. i used this module ( great module thank you) in Angular 8.

i added this to my component.ts


import { polyfill } from 'mobile-drag-drop';
import { scrollBehaviourDragImageTranslateOverride } from 'mobile-drag-drop/scroll-behaviour';

  ngOnInit() {
    polyfill( {
      // use this to make use of the scroll behaviour
      dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride
    } );

    window.addEventListener( 'touchmove', () => { }, { passive: false } );
  }

And it worked like a charm.. i will keep testing this in different browsers and will let you know.