MouseEvent offsetX, offsetY return 0 value when accessed outside of event handler stack
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: st3v0, Unassigned)
Details
Steps to reproduce:
I debounced the mouse event to avoid reflows. And tried to access the offsetX property from the debounced event.
This doc (https://gist.github.com/paulirish/5d52fb081b3570c81e3a) states that offsetX/Y can trigger a reflow.
I've created a codesandbox example to demonstrate the issue:
https://codesandbox.io/p/sandbox/dreamy-sun-xrspkl
Demo: https://xrspkl.csb.app/
Just run the demo in both chrome/firefox and notice that the offset values always return 0 in firefox only.
Actual results:
The mouse event offset values always return 0 in firefox only, when accessed from a deferred callback.
Expected results:
I would expect the offset values to be non-zero and accurately reflect the the current offset x/y. I would also expect it to behave the same across all browsers, currently this is only broken in firefox; chrome, safari & edge all work the same.
Comment 1•9 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Events' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•8 months ago
|
Updated•8 months ago
|
Description
•