Multiple <WindowScrollers> on a page cause a race condition
See original GitHub issueIf you have more than one <WindowScroller>
on a page the body will, after scrolling, have its pointerEvents
style permanently set to none
.
The issue is that each instance saves the current pointerEvents
value inside its onScroll handler (so it can restore it after scrolling), then sets it to none
. When the second scroll handler fires, it sees that pointerEvents
is set to none
, so when its _enablePointerEventsAfterDelayCallback
fires, it “restores” it to none
regardless of what the original value actually was.
(see this plunker for a demo)
A (relatively) simple fix would be to modify the event handling of <WindowScroller>
to just attach a single scroll handler to the document. This handler could modify/restore the body’s pointerEvents
style, and pass scrollTop values to mounted components.
I can issue a PR if it’d help.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
That was amazingly fast, thanks again!
Sounds reasonable. I greatly appreciate the PR!
As I mentioned, I’m on the road for the next few days- but I’ll try to find time to review it within the next few hours if I can. 😄