Skip to content

fix(DialogHost): restore focus inside dialog after window is minimized and restored - #4121

Open
corvinsz wants to merge 2 commits into
MaterialDesignInXAML:masterfrom
corvinsz:fix3434-2
Open

corvinsz wants to merge 2 commits into
MaterialDesignInXAML:masterfrom
corvinsz:fix3434-2

Conversation

@corvinsz

@corvinsz corvinsz commented Nov 8, 2026

Copy link
Copy Markdown
Member

fixes #3434

I had another look at the above issue.
If I didn't miss an edge case, I think all the extra complexity we introduced in the previous PR (#3923) isn't necessary?

  • The DialogHost now remembers the last focused element inside the popup and focuses it again when the window is activated.
  • It forgets that element when focus moves to another element in the same window, so focus that was outside the dialog is not pulled into it. Thats what the additional test DialogHost_WhenWindowStateChanges_FocusOutsideDialogStaysOutside is for.

This branch has not been deployed

No deployments
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.

DialogHost accessibility issue

1 participant