Skip to content
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

Only drag zoom on left mouse button #671

Merged
merged 1 commit into from Sep 1, 2022

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Sep 1, 2022

This makes drag act the same as pan (which is implemented by Hammer.js, which - as far as I can tell - automatically only listens to the left / primary mouse button).

By default, right-click is intercepted by the browser to display a context menu, so this isn't noticeable, However, if oncontextmenu is used to disable that (e.g., to use JS to display a menu instead), then right-click can trigger zoom, which feels strange.

This makes drag act the same as pan (which is implemented by Hammer.js, which - as far as I can tell - automatically only listens to the left / primary mouse button).

By default, right-click is intercepted by the browser to display a context menu, so this isn't noticeable,  However, if `oncontextmenu` is used to disable that (e.g., to use JS to display a menu instead), then right-click can trigger zoom, which feels strange.
@kurkle kurkle merged commit 65dbaaa into chartjs:master Sep 1, 2022
@joshkel joshkel deleted the drag-left-mouse-button branch September 4, 2022 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants