From e6ebe3f17413dcb00e5ca6075951ed070d87297f Mon Sep 17 00:00:00 2001 From: thomasrosen Date: Sat, 23 Jan 2021 13:48:24 +0100 Subject: [PATCH] BUGFIX prevent scrolling on the editor element on iOS --- src/Editor.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Editor.js b/src/Editor.js index 49c7a98..45b27d8 100644 --- a/src/Editor.js +++ b/src/Editor.js @@ -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',