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:
parent
715044e381
commit
e6ebe3f174
1 changed files with 16 additions and 1 deletions
|
@ -161,7 +161,22 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
||||||
if (!hammer_got_init && !!editorRef && !!editorRef.current) {
|
if (!hammer_got_init && !!editorRef && !!editorRef.current) {
|
||||||
const element = 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, {
|
set_hammertime(new Hammer(element, {
|
||||||
direction: 'DIRECTION_ALL',
|
direction: 'DIRECTION_ALL',
|
||||||
|
|
Loading…
Reference in a new issue