diff --git a/draftlogs/7474_fix.md b/draftlogs/7474_fix.md new file mode 100644 index 00000000000..7c8e11859ee --- /dev/null +++ b/draftlogs/7474_fix.md @@ -0,0 +1 @@ +- Fix scroll wheel zoom for geo subplots in Safari [#7474](https://github.com/plotly/plotly.js/pull/7474) diff --git a/src/lib/events.js b/src/lib/events.js index 364400bf8d1..6202ece21ef 100644 --- a/src/lib/events.js +++ b/src/lib/events.js @@ -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", () => {}); + } + return plotObj; },