Skip to content

Conversation

@anlumo
Copy link
Contributor

@anlumo anlumo commented Oct 23, 2025

When a scroll view contains an item that has focus and the window is resized so that the item would scroll out of view, the scroll view is scrolled so that the item stays visible.

This PR also adds the "scroll to visible" functionality to elements when gaining focus, but I haven't found a way yet to get offscreen elements to gain focus, so I couldn't test this. It does work for partially clipped items though.

Fixes #3067

@anlumo anlumo requested a review from ogoffart October 23, 2025 12:35
@anlumo anlumo self-assigned this Oct 23, 2025
@anlumo anlumo added a:builtin elements The runtime data structures related to the items (mO,bT) a:flickable The implementation of the Flickable (mO) rust Pull requests that update rust code labels Oct 23, 2025
Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

Nice.

Could you add a test in tests/cases?
You can see existing test case for the flickable in tests/cases/elements/flickable and the focus in tests/cases/focus

@anlumo anlumo force-pushed the anlumo/3067-scroll-into-view branch 2 times, most recently from 37486b8 to 4dc0e78 Compare October 23, 2025 13:18
@anlumo anlumo force-pushed the anlumo/3067-scroll-into-view branch from 131d2fe to dcd6fce Compare October 23, 2025 13:40
@anlumo anlumo force-pushed the anlumo/3067-scroll-into-view branch from 92534ec to 2dbfb20 Compare October 24, 2025 09:27
Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

Very good, thank you.

@anlumo anlumo merged commit affbb7b into master Oct 24, 2025
41 checks passed
@anlumo anlumo deleted the anlumo/3067-scroll-into-view branch October 24, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:builtin elements The runtime data structures related to the items (mO,bT) a:flickable The implementation of the Flickable (mO) rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab navigation in ScrollView don't scroll to keep the focus widget visible

2 participants