drozhzhin-n-e / ngx-pinch-zoom

Module provides for image zooming and positioning with use of gestures on a touch screen.
http://ivylab.space/pinch-zoom
MIT License
113 stars 95 forks source link

Events on body don't stop listen after destroy component #39

Closed Rockstar311 closed 4 years ago

Rockstar311 commented 5 years ago

In chrome after destroying component, I can't select some text on the page. After research I found that after destroy component of pinch-zoom, on element events don't stop listening. So on we still have event mousemove and with this event we can't select a text on a page

Rockstar311 commented 4 years ago

I was found a solution to fix the selection of text, on destroying your component need call method from deep this.pinchZoomComponent.pinchZoom.touches.destroy();

drozhzhin-n-e commented 4 years ago

I will try to fix the problem with text selection. In the latest version of the component, unsubscribing from mouse events occurs automatically.

https://github.com/drozhzhin-n-e/ngx-pinch-zoom/blob/master/src/app/pinch-zoom/pinch-zoom.component.ts#L103