Bug 226683

Summary: Wheel event is not fired on any SVG element
Product: WebKit Reporter: Jay Wang <xiao.hk1997>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: adodson, dino, graouts, karlcow, sabouhallawa, simon.fraser, thorton, victor.anan17, webkit-bug-importer, zimmermann
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 10.14   
Attachments:
Description Flags
reduced test case none

Description Jay Wang 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)
Comment 1 Jay Wang 2021-06-05 08:19:53 PDT
Here is a related question on stack overflow (https://stackoverflow.com/questions/67836886/wheel-event-is-not-fired-on-a-svg-group-element-in-safari)
Comment 2 Said Abou-Hallawa 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.
Comment 3 Said Abou-Hallawa 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.
Comment 4 Victor Ananiev 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).
Comment 5 Radar WebKit Bug Importer 2021-06-12 08:17:14 PDT
<rdar://problem/79240222>
Comment 6 Simon Fraser (smfr) 2022-08-26 12:19:14 PDT
This is because we don't build event regions inside SVG content.