Scrolling an element with opacity: 0; does not fire "scroll" events
Categories
(Core :: Layout, defect, P3)
Tracking
()
People
(Reporter: denschub, Unassigned)
References
Details
Attachments
(2 files)
For the easiest possible explanation, see the attached testcase. There is a 10000x10000px div inside a viewport-filling container. On that div, there is an event listener for the scroll event. The 10k pixel container has opacity: 0;
, so you won't see it, but it's still there.
Open a console, scroll around in the content, and observe the console. Nothing happens. If you try the same in Chrome, you'll notice that Chrome does indeed fire scroll events. Even more interesting: If you open the testcase in Fennec and try to scroll, you'll notice that Fennec does fire touchmove events, but no scroll events.
Now, as weird as this use case is, a site is actually using it to catch events for a sliding UI element. That works just fine in Chrome, but as we eat the scroll events, it breaks in Firefox.
I didn't find anything in the specs that would allow us to not dispatch scroll events on an transparent element, but I'm happy to be corrected. :)
Reporter | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
->layout which decides when to fire scroll events.
Comment 2•6 years ago
|
||
Fwiw, if you use 'visibility: hidden' instead then Chrome also stops generating scroll events.
Comment 3•6 years ago
•
|
||
We do dispatch scroll events on the first testcase if you click and then press spacebar, or pageup/pagedown, or uparrow/downarrow.
It seems to be specifically mousewheel-scrolling (or equivalently, laptop-touchpad scrolling) that doesn't work -- so presumably those mousewheel events aren't making it through to the scrollable element.
Comment 4•6 years ago
|
||
Interestingly, with the first test case I can see scroll events on mouse wheel scrolling on my Linux box Ubuntu 18.04.
Updated•6 years ago
|
Updated•5 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 5•9 months ago
|
||
This appears to be fixed - the testcase I attached is now dispatching scroll events.
Description
•