You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The section nor "Firing a synthetic pointer event named e" section does not define about detail. The value is "click count" if the event name is "click". Mozilla gets a interop bug report about this. When you click an HTMLLabelElement, only Firefox sets the detail of synthetic "click" event to the source event's value. However, the other browsers set it to 0. Although the value is odd because 0-times click causes the "click" event, however, according to this comment, the value is used by React to consider whether the click event is synthetic one or user initiated one. Therefore, it may make sense Mozilla to align the behavior to the others. (Note that I've not checked the other synthetic "click" events' detail value, e.g., typing Enter on <a href="..."> and <input type="submit">.)
Ideally, there should be a new attribute to indicate whether synthetic one or not. However, it's impossible to expect that all React instances will be replaced with newer version soon. Therefore, keep using the detail for this purpose must be reasonable.
Additionally, pointerId and pointerType should also be clarified too. See my comment in the bug too.
The text was updated successfully, but these errors were encountered:
I think the sentence in HTMLLabelElement definition made me misled at least. And Chrome uses non-default value for pointerId. They set -1 but its default is 0.
annevk
changed the title
Clearify detail value of synthetic click event
Clarify detail value of synthetic click event
May 16, 2024
What is the issue with the HTML Standard?
https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-click-event
The section nor "Firing a synthetic pointer event named e" section does not define about
detail
. The value is "click count" if the event name is "click". Mozilla gets a interop bug report about this. When you click anHTMLLabelElement
, only Firefox sets the detail of synthetic "click" event to the source event's value. However, the other browsers set it to0
. Although the value is odd because 0-times click causes the "click" event, however, according to this comment, the value is used by React to consider whether the click event is synthetic one or user initiated one. Therefore, it may make sense Mozilla to align the behavior to the others. (Note that I've not checked the other synthetic "click" events'detail
value, e.g., typingEnter
on<a href="...">
and<input type="submit">
.)Ideally, there should be a new attribute to indicate whether synthetic one or not. However, it's impossible to expect that all React instances will be replaced with newer version soon. Therefore, keep using the
detail
for this purpose must be reasonable.Additionally,
pointerId
andpointerType
should also be clarified too. See my comment in the bug too.The text was updated successfully, but these errors were encountered: