NEW 226683
Wheel event is not fired on any SVG element
https://bugs.webkit.org/show_bug.cgi?id=226683
Summary Wheel event is not fired on any SVG element
Jay Wang
Reported 2021-06-05 08:16:47 PDT
I am trying to bind a wheel event listener to a SVG group element with D3. It seems the wheel event is not triggered when I scroll on the group element in Safari (the group is not empty). It works fine on Firefox or Chrome. For a demo, see this codepen (https://codepen.io/xiaohk/pen/oNZdwoO). Interestingly, it works as expected if the wheel event listener is bound to the SVG element instead of one <g> element. For example, see this codepen (https://codepen.io/xiaohk/pen/vYxjZdY)
Attachments
reduced test case (869 bytes, text/html)
2021-06-07 13:25 PDT, Said Abou-Hallawa
no flags
Jay Wang
Comment 1 2021-06-05 08:19:53 PDT
Said Abou-Hallawa
Comment 2 2021-06-07 13:24:25 PDT
This is actually applied to <rect> element as well which suggests the bug is applied to all SVG elements.
Said Abou-Hallawa
Comment 3 2021-06-07 13:25:11 PDT
Created attachment 430775 [details] reduced test case This test case shows the bug can happen with the SVG <rect> element.
Victor Ananiev
Comment 4 2021-06-10 14:55:49 PDT
I found that binding first a wheel event to a containing HTML element (like 'SVG' or document.body) makes this working. See my comment on stack overflow (https://stackoverflow.com/questions/67836886/wheel-event-is-not-fired-on-a-svg-group-element-in-safari).
Radar WebKit Bug Importer
Comment 5 2021-06-12 08:17:14 PDT
Simon Fraser (smfr)
Comment 6 2022-08-26 12:19:14 PDT
This is because we don't build event regions inside SVG content.
Note You need to log in before you can comment on or make changes to this bug.