Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@theclapp
Copy link
Contributor

WidgetBase.focusableInThis() says it "returns the first Focusable element within this widget". It calls WidgetWalkDown.

WidgetWalkDown calls the given function and stops walking the current branch of the tree if the function returns false. But then it keeps going with other branches of the tree. Which means if there are multiple focusable child widgets, focusableInThis seems to return the last Focusable widget.

Instead, abort the walk if the first focusable widget has been found.

First reported in Slack.

WidgetBase.focusableInThis() says it "returns the first Focusable
element within this widget". It calls WidgetWalkDown.

WidgetWalkDown calls the given function and stops walking the current
branch of the tree if the function returns false. But then it keeps
going with other branches of the tree. Which means if there are multiple
focusable child widgets, focusableInThis seems to return the last
Focusable widget.

Instead, abort the walk if the first focusable widget has been found.
Copy link
Member

@kkoreilly kkoreilly left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@kkoreilly kkoreilly merged commit d1d0e59 into cogentcore:main Jul 31, 2025
1 check failed
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.

2 participants