Skip to content

Commit

Permalink
Specify wheel event groups
Browse files Browse the repository at this point in the history
Specify the behavior of wheel event groups.
  • Loading branch information
dlrobertson committed Mar 16, 2023
1 parent 71fa963 commit 5c81ac6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions sections/event-types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2180,11 +2180,12 @@ myDiv.addEventListener("auxclick", function(e) {
+| Sync / Async | Async |
+| Bubbles | Yes |
+| Trusted Targets | <code>Element</code> |
+| Cancelable | <a href="#cancelability-of-wheel-events">Varies</a> |
+| Cancelable | <a href="#cancelability-of-wheel-events">Varies</a> |
+| Composed | Yes |
+| Default action | Scroll (or zoom) the document |
+| Context<br/> | <ul> |
| (trusted events) | <li>{{Event}}.{{Event/target}} : <a>topmost event target</a></li> |
| (trusted events) | <li>{{Event}}.{{Event/target}} : element target for the current wheel event group or |
| | if no wheel event group has started, then the <a>topmost event target</a></li> |
| | <li>{{UIEvent}}.{{UIEvent/view}} : <a><code>Window</code></a></li> |
| | <li>{{UIEvent}}.{{UIEvent/detail}} : <code>0</code></li> |
| | <li>{{MouseEvent}}.{{MouseEvent/screenX}} : if the wheel is associated with a |
Expand Down Expand Up @@ -2236,6 +2237,19 @@ myDiv.addEventListener("auxclick", function(e) {
EVENT{wheel} event with multiple non-zero axes or as separate
EVENT{wheel} events for each non-zero axis.

A <a>user agent</a> SHOULD create a wheel event group when the first
wheel event is fired, so that all subsequent wheel events within a
implementation-specific amount of time can be targetted at the same
element.

<p class="example">
If a series of wheel events targetted in a scrollable element start
above a child element, later events for the same user gesture may
occur over the child element. In the case that {{Event/preventDefault()}}
is called in a wheel event handler for the child element, targetting
the child element could result in unexpected behavior for the user.
</p>

The typical <a>default action</a> of the EVENT{wheel} event type is
to scroll (or in some cases, zoom) the document by the indicated
amount. If this event is canceled, the implementation MUST NOT
Expand Down

0 comments on commit 5c81ac6

Please sign in to comment.