Skip to content
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

fix: Node::is_focusable always returns true if the node is focused #451

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

mwcampbell
Copy link
Contributor

I think it's reasonable to only add a given action to a node if that action does something meaningful in the node's current state. And we may want to recommend that. But things like the UIA IsKeyboardFocusable property and the AT-SPI focusable state should be set even when the node is already focused, so the node might not have the Focus action in that state.

One subtlety: I added a helper, is_focused_in_tree, to check whether the node is focused within the tree, regardless of whether the host (e.g. window) is focused. If the node is focused in the tree, then the node might not have the Focus action, regardless of whether the host is focused.

@DataTriny DataTriny merged commit d286883 into main Sep 14, 2024
9 checks passed
@DataTriny DataTriny deleted the fix-is-focusable branch September 14, 2024 13:20
@github-actions github-actions bot mentioned this pull request Sep 14, 2024
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