bevy/examples/ui
Tim 9ba643d7ba
Robust Scrolling Example (#19586)
# Objective

A more robust scrolling example that doesn't require `Pickable {
should_block_lower: false, .. }` or `Pickable::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 the `OnScroll` 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.
2025-07-14 20:24:15 +00:00
..
borders.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
box_shadow.rs Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
button.rs Color interpolation in OKLab, OKLCH spaces for UI gradients (#19330) 2025-06-21 15:06:35 +00:00
core_widgets_observers.rs Changing the notification protocol for core_widgets. (#20086) 2025-07-13 17:25:11 +00:00
core_widgets.rs Changing the notification protocol for core_widgets. (#20086) 2025-07-13 17:25:11 +00:00
directional_navigation.rs Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
display_and_visibility.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
feathers.rs Changing the notification protocol for core_widgets. (#20086) 2025-07-13 17:25:11 +00:00
flex_layout.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
font_atlas_debug.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
ghost_nodes.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
gradients.rs HSL and HSV interpolation for UI gradients (#19992) 2025-07-07 20:08:51 +00:00
grid.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
overflow_clip_margin.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
overflow_debug.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
overflow.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
relative_cursor_position.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
render_ui_to_texture.rs Rename TargetCamera to UiTargetCamera (#17403) 2025-01-19 19:56:57 +00:00
scroll.rs Robust Scrolling Example (#19586) 2025-07-14 20:24:15 +00:00
scrollbars.rs Newtyped ScrollPosition (#19881) 2025-07-01 17:41:48 +00:00
size_constraints.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
stacked_gradients.rs Color interpolation in OKLab, OKLCH spaces for UI gradients (#19330) 2025-06-21 15:06:35 +00:00
tab_navigation.rs Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
text_background_colors.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text_debug.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text_wrap_debug.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
transparency_ui.rs Merge Style properties into Node. Use ComputedNode for computed properties. (#15975) 2024-10-18 22:25:33 +00:00
ui_material.rs ui_material example webgl2 fix (#17852) 2025-02-13 20:52:26 +00:00
ui_scaling.rs Rename Timer::finished and Timer::paused to is_finished and is_paused (#19386) 2025-05-27 22:24:18 +00:00
ui_texture_atlas_slice.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
ui_texture_atlas.rs UiImage -> ImageNode, UiImageSize -> ImageNodeSize (#16271) 2024-11-07 21:52:58 +00:00
ui_texture_slice_flip_and_tile.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
ui_texture_slice.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
ui_transform.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
viewport_debug.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
viewport_node.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
window_fallthrough.rs Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
z_index.rs Updated comment: ZIndex::Local(0) -> ZIndex(0). (#16585) 2024-12-01 20:09:09 +00:00