Skip to content

Scrollbars autohide, select fix for reselecting current item closing popup#25057

Open
gagnus wants to merge 2 commits into
bevyengine:mainfrom
gagnus:feathers-select-scrollbar-fixes
Open

Scrollbars autohide, select fix for reselecting current item closing popup#25057
gagnus wants to merge 2 commits into
bevyengine:mainfrom
gagnus:feathers-select-scrollbar-fixes

Conversation

@gagnus

@gagnus gagnus commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Objective / Solution

  • Select control didn't close when reselecting the current item (mouse or keyboard), because that doesn't send an event from underlying widget (list). Added a new event ReselectListRow to bevy_ui_widget and send that, picked it up in select to close the select.
  • Scrollbar was hugging the right side of the popup too much so added some padding on it.
  • Scrollbar was visible whether content fitted or not. Added an auto_hide (default to true).

Solution

cargo run --example feathers_gallery --features bevy_feathers


Showcase

Select where all items fit:

image

Select where they don't:

image

@alice-i-cecile alice-i-cecile added the A-UI Graphical user interfaces, styles, layouts, and widgets label Jul 18, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Jul 18, 2026
@alice-i-cecile alice-i-cecile added the C-Bug An unexpected or incorrect behavior label Jul 18, 2026
@alice-i-cecile alice-i-cecile added this to the 0.20 milestone Jul 18, 2026
@alice-i-cecile alice-i-cecile added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 18, 2026
&& let Ok((gutter, mut node)) = q_gutters.get_mut(child_of.parent())
{
let padding = if overflows { gutter.0 } else { Val::ZERO };
if node.padding.right != padding {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest adding a clarifying note here, as this makes certain assumptions about the layout structure of the parent container - those assumptions are true in the case of feathers, but may not be true for non-feathers widgets generally.

For example, a headless scrollbar can be placed in a grid, a flexbox, or it can float on top as a separate layer. For a floating scrollbar, altering the padding of the parent wouldn't be the right move.

Also, the above code appears to handle both horizontal and vertical scrollbars, but I would think that adjusting the right padding would only work for vertical scrollbars.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good spot, thanks. will add comment to make clear ScrollbarGutter is just for padding based ones and fix horizontal.

… also added comment on gutter to make clear its only for padding based scrollbars
@gagnus

gagnus commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

both scrollbars

image

reclaim horizontal (the bug)

image

reclaim vertical (existing working)

image

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 19, 2026
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-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants