Skip to content

Create a new OverflowAxis that allows scrolling while keeping overflown items visible #19773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hukasu
Copy link
Contributor

@hukasu hukasu commented Jun 21, 2025

Objective

If you want to create a node that has a long list of items, have all of them visible and scroll through them, you would need to fiddle with Node::left or Node::right

Solution

Create OverflowAxis::ScrollNoClip that keeps all items visible and allows you to scroll using ScrollPosition

Showcase

overflow_scroll example
image

image

@hukasu hukasu added C-Feature A new feature, making something new possible A-UI Graphical user interfaces, styles, layouts, and widgets M-Needs-Release-Note Work that should be called out in the blog due to impact labels Jun 21, 2025
Copy link
Contributor

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

@hukasu hukasu added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jun 21, 2025
@hukasu hukasu mentioned this pull request Jun 21, 2025
@viridia
Copy link
Contributor

viridia commented Jun 22, 2025

you would need to fiddle with Node::left or Node::right

Why is that so bad? I think you need a clearer justification for this change.

@hukasu
Copy link
Contributor Author

hukasu commented Jun 22, 2025

Using ScrollPosition you don't need to check for the bounds, as it is already dealt with by bevy

@alice-i-cecile alice-i-cecile added the X-Contentious There are nontrivial implications that should be thought through label Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible M-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants