-
-
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
Fix allow touch scrolling #5904
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied this to my code and it's working fine.
Works just fine for me. |
allowTouchScrolling is not working on iPad as of last version of fabric.js. BUT works perfectly with e.g. version 2.3.3. This is driving me crazy. |
This should fix it. |
This worked for me as well. |
This fix works to fix the scroll, But... When you put an object and moveit arround, the scroll canvas also move with it, anyone worked on a solution on that?. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this fix to my code I have been using it for 6 months without noticing any side-effects.
Hey @royercross , I had the same issue and fixed it by using a logic to enable and disable the scrolling. Like this:
|
i tried that, but the problem is on mobile only, if you move an element to quickly and fast, you get an error because you cannot prevent scrolling event if it is alrready happening. So i found another solution in case anyone need it.
|
i tried the solutions above but scrolling is still not working on my end with mobile devices |
Will it take more to merged? |
well, combined peoples solutions I got result with this code
//(!) Important, this code above should be before fabric canvas init and "allowTouchScrolling: true" should be added (v.4.2.0): Thanks for all ! |
it does not work for me |
Any reason why this has never been merged? We could really use it in our project. That fix above worked but still, why can't the PR just be merged? |
_onTouchStart: function(e) {
let targetR = this.findTarget(e);
if(!this.allowTouchScrolling || targetR){
e.preventDefault && e.preventDefault();
}
if (this.mainTouchId === null) {
this.mainTouchId = this.getPointerId(e);
}
// ...
},
_onMouseMove: function (e) {
let targetR = this.findTarget(e);
if(!this.allowTouchScrolling || targetR){
e.preventDefault && e.preventDefault();
}
this.__onMouseMove(e);
}, This work for me |
#5903