Bug 226683 - Wheel event is not fired on any SVG element
Summary: Wheel event is not fired on any SVG element
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 10.14
: P2 Major
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2021-06-05 08:16 PDT by Jay Wang
Modified: 2022-08-26 12:19 PDT (History)
10 users (show)

See Also:


Attachments
reduced test case (869 bytes, text/html)
2021-06-07 13:25 PDT, Said Abou-Hallawa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.