Skip to content

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jul 31, 2025

What does the pull request do?

Supercedes #19325
When a control is detached from visual tree, it can't have keyboard focus, thus we set IsKeyboardWithin to false. The detached event moves down the tree from the detached visual so all descendants also set the property to false.

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #19299

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0057926-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added bug backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Jul 31, 2025
Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM!

@MrJul MrJul added this pull request to the merge queue Aug 1, 2025
Merged via the queue into master with commit 0f233c2 Aug 1, 2025
13 checks passed
@MrJul MrJul deleted the focus_within_reset_on_detach branch August 1, 2025 09:33
MrJul pushed a commit that referenced this pull request Aug 5, 2025
…al tree (#19369)

* add failing IsKeyboardFocusWithin test for popup

* Set IsKeyboardWithin to false when detached from visual tree
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoCompleteBox: After selecting an item and typing again, dropdown closes and textbox loses focus (with AsyncPopulator)
3 participants