-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Free drawing on IOS disables page scrolling #3756
Comments
Here is a small fiddle if needed: https://jsfiddle.net/u0k02u9f/ This issue breaks the scroll functionality of nearly any web-app/web-page on IOS Safari that uses fabric.js to draw on the canvas. |
i guess the problem is the window events attached by fabric. ios safari is not on my list of devices sadly, i can just guess |
@asturur thanks for quick reply! |
please have a look at the file in the mixin folder called canvas-events |
If my memory is good on iOS you set a preventDefault on the touchmove event on the body to prevent the elastic scroll from the safari navigator. in fabric.js there is a listener added on the "document" for the "touchmove" event to call the function "_onMouseMove()" who call the preventDefault if "allowTouchScrolling = false". It's perhaps the source of your problems (PS : this parameter is set to false by default). I don't have an ipad, so it's just a guess. Try this fiddle to see if it's better. |
back to this topic, you hit the issue! Setting CSS:
JS:
|
@guari I can't reproduce it on iOS Safari 10.2. I can scroll the page after the canvas is touched. Everything looks good to me. Can you record a small video of your issue. |
@Kienz I uploaded here a video: https://vid.me/82mJ
the video is recorded on an iPhone 6 IOS 8, yesterday I noticed the same behavior on iPhone 6S IOS 9, I haven't tested on more recent iPhone versions for now, but it's likely that Apple finally started to fix some of all those browser quirks introduced with older Safari versions... :) (jsfiddles uses the latest version of fabric.js on github by rawgit) |
to be handled in #3869 |
Test Case
http://fabricjs.com/freedrawing
Steps to reproduce
Start to draw something with a touch
Expected Behavior
You should be able to scroll the page when swiping an area that is not the canvas one
Actual Behavior
Scroll is 'locked' and there seem to be no way to unlock again (like eg. an evt.preventDefault() is called on document touchmove when should not).
This happens only on IOS Safari, tested on affected devices: iPhone 6S IOS 9, iPhone 6 IOS 8, iPhone 5 IOS 6, iPad Air IOS 8.3; instead on Android with Chrome everything run perfectly). The bug starts when the canvas is touched and something is drawn, until nothing is drawn on the canvas, the bug does not appear.
Toggling
isDrawingMode
true/false does not solve the issue because scrolling remains locked.The text was updated successfully, but these errors were encountered: