Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
A more robust scrolling example that doesn't require
Pickable { should_block_lower: false, .. }
orPickable::IGNORE
, and properly handles nested scrolling nodes.The current example shows nested scrolling, but this is only functional because the parent scrolls along a different axis than the children.
Solution
Instead of only scrolling the top node that is found in the
HoverMap
we trigger theOnScroll
event on it.This event then propagates up the hierarchy until any scrolling node that has room to scroll along that axis consumes the event.
The now redundant
Pickable
components were removed from the example.The “Nested Scrolling Lists” portion was adjusted to show the new reliable nested scrolling.
Testing
Check out the example. It should work just as it did before.