Skip to content

Improve the accuracy of the docs for beforeMouseDown #285

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

Merged
merged 1 commit into from
Jun 19, 2022

Conversation

stampyzfanz
Copy link
Contributor

@stampyzfanz stampyzfanz commented Jun 19, 2022

There was a bug in an application I was working on where I used beforeMouseDown to disable panning and it was very hard to debug why it still panned using touch. This change will allow users to know exactly what beforeMouseDown does. Evidence that it doesn't disable panning using touch located in this fiddle: https://jsfiddle.net/thg2brxe/.

Copy link
Contributor Author

@stampyzfanz stampyzfanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the docs to reflect what it does is a nice first step, but it would also be nice for there to be a documented function that conditionally disables panning when it is initiated via a touch screen as well.

@anvaka anvaka merged commit 0762540 into anvaka:master Jun 19, 2022
@anvaka
Copy link
Owner

anvaka commented Jun 19, 2022

Thank you for your comment. I agree, the API is not symmetrical which can lead to unmet expectations. We could add beforeTouchDown() to make it symmetrical - would this help?

@taibhse-designs
Copy link

Thank you for your comment. I agree, the API is not symmetrical which can lead to unmet expectations. We could add beforeTouchDown() to make it symmetrical - would this help?

For an application I am building, beforeTouchDown would be highly appreciated, I need to be able to disable panning on touch devices unless my canvas has been zoomed into, or atleast be able to disable left right panning,

@stampyzfanz
Copy link
Contributor Author

Im my project, I ended up editing the source code to get the beforeMouseDown check to both touch events and scroll events. I didn't want the user to be able to pan in any way or scroll while hovering over a button.

Adding a beforeTouchDown would be helpful would assist in this, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants