woutervh-/react-pan-and-zoom-hoc

Add { passive: false } to allow event.preventDefault()

blaues0cke opened this issue · 3 comments

This kinda relates to https://github.com/woutervh-/react-pan-and-zoom-hoc/issues/12 but I want to leave it here for discussions. As described in this stackoverflow post and the documentation of "addEventListener" touchmove stopped to be cancelable using event.preventDefault() until we register the event listender like this:

document.addEventListener('touchmove', this.handleMouseMove, {passive: false});

In my opinion its ok the keep this like the current version, but maybe there should be an option to "enable" the {passive: false}-flag?

Hi @blaues0cke

Thanks for the heads up. I think it's a good idea to add the passive: false flag by default since it is the intended behavior of the library. I will make an update and keep you updated.

Fixed in version 2.1.5

Thank you very much! :-)