Skip to content

Commit c9a6b3b

Browse files
authored
Merge pull request #7474 from plotly/safari-scroll-zoom
Add dummy 'wheel' event handler to enable scroll zoom on safari
2 parents 073c342 + 72c2269 commit c9a6b3b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

draftlogs/7474_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix scroll wheel zoom for geo subplots in Safari [#7474](https://github.com/plotly/plotly.js/pull/7474)

src/lib/events.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ var Events = {
5959
internalEv.emit(event, data);
6060
};
6161

62+
/*
63+
* Add a dummy event handler for 'wheel' event for Safari
64+
* to enable mouse wheel zoom.
65+
* https://github.com/d3/d3/issues/3035
66+
* https://github.com/plotly/plotly.js/issues/7452
67+
*/
68+
if(typeof plotObj.addEventListener === 'function') {
69+
plotObj.addEventListener("wheel", () => {});
70+
}
71+
6272
return plotObj;
6373
},
6474

0 commit comments

Comments
 (0)