Skip to content

feat: reactive ui elements with overflow scroll follow the mouse wheel - #732

Draft
makspll wants to merge 7 commits into
agent/reactive-ui-examplefrom
agent/reactive-ui-scroll
Draft

makspll wants to merge 7 commits into
agent/reactive-ui-examplefrom
agent/reactive-ui-scroll

Conversation

@makspll

@makspll makspll commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Draft: not verified with a real mouse wheel, there is no pointer in this environment.

An element whose overflow is "scroll" on an axis scrolls with the mouse wheel: an observer of PointerScroll moves the ScrollPosition of the innermost such element under the pointer, no script code involved. on_scroll handlers still get the event.

ui.node({ height = 300, overflow = { y = "scroll" } }, { ui.list(items, row) })

The example's inventory uses it.

This is the scroll half of "scroll and text input". Not done:

  • a virtualised list (only the visible rows mounted), the real answer for thousands of rows
  • text input with focus and two way binding. bevy_ui 0.20 has text input layout and bevy_input_focus, wiring them to signals is its own piece of work

Stacked on #731.

@semanticdiff-com

semanticdiff-com Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  assets/scripts/inventory_ui.lua  28% smaller
  crates/bevy_mod_scripting_reactive_ui/src/lib.rs  27% smaller
  examples/reactive_ui.rs  15% smaller
  Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_reactive_ui/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_reactive_ui/src/events.rs  0% smaller
  docs/src/ReactiveUi/reference.md Unsupported file format

@makspll
makspll added this pull request to stack #718 November 13, 2026 13:36
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBevy Scripting
Branchagent/reactive-ui-scroll
Testbedlinux-gha

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

🐰 View full continuous benchmarking report in Bencher

- `ui.render` roots were auto-sized: bevy_ui wraps root nodes in an implicit grid with an auto track, so
  `height = "100%"` in a script was of the content and nothing overflowed to scroll. Roots are now
  100vw x 100vh and ignore picking.
- The test harness initialises image assets (the reactive ui no longer does, since bc800c8).
- Example: restyled, cards fill the width, hover states, Rust eases each item's stock bar and flashes
  restocked items (rows bind to the fields, only moving rows update).
# Conflicts:
#	crates/testing_crates/script_integration_test_harness/src/lib.rs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant