Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2k
Add dummy 'wheel' event handler to enable scroll zoom on safari#7474
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
06c3e7fe6618c63ebf3bdb142a3d4a54374b5deb4d76c855d72c2269File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -59,6 +59,16 @@ var Events = { | ||
| internalEv.emit(event, data); | ||
| }; | ||
| /* | ||
| * Add a dummy event handler for 'wheel' event for Safari | ||
| * to enable mouse wheel zoom. | ||
| * https://github.com/d3/d3/issues/3035 | ||
| * https://github.com/plotly/plotly.js/issues/7452 | ||
| */ | ||
| if(typeof plotObj.addEventListener === 'function') { | ||
| plotObj.addEventListener("wheel", () => {}); | ||
| } | ||
Comment on lines +68 to +70 Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why is the ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @camdecoster There's severaltests which pass an empty object ( I'm not sure if ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Looks like in the actual code (tests aside), ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I wonder if we should modify the tests rather than adding this Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Maybe just use the optional chaining operator? I think that would essentially do the same thing as the ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nice, TIL. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @camdecoster I've reverted to the Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yes, this code will work fine. | ||
| return plotObj; | ||
| }, | ||