1
0
Fork 0
mirror of https://github.com/voltbonn/profile-picture-generator.git synced 2024-12-22 15:55:08 +00:00

BUGFIX prevent scrolling on the editor element on iOS

This commit is contained in:
thomasrosen 2021-01-23 13:48:24 +01:00
parent 715044e381
commit e6ebe3f174

View file

@ -161,7 +161,22 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
if (!hammer_got_init && !!editorRef && !!editorRef.current) {
const element = editorRef.current
element.addEventListener('mousedown', e => e.preventDefault(), false)
element.addEventListener('mousedown', event => {
event.preventDefault()
// event.stopPropagation()
}, false)
element.addEventListener("touchstart", event => {
event.preventDefault()
// event.stopPropagation()
}, false)
element.addEventListener("touchend", event => {
event.preventDefault()
// event.stopPropagation()
}, false)
element.addEventListener("touchmove", event => {
event.preventDefault()
// event.stopPropagation()
}, false)
set_hammertime(new Hammer(element, {
direction: 'DIRECTION_ALL',