Skip to content

Fix focus issues with ContentDialog#931

Merged
pomianowski merged 3 commits intolepoco:developmentfrom
jackBonadies:development
Feb 5, 2024
Merged

Fix focus issues with ContentDialog#931
pomianowski merged 3 commits intolepoco:developmentfrom
jackBonadies:development

Conversation

@jackBonadies
Copy link
Copy Markdown
Contributor

Pull request type

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Currently, ContentDialog has 2 focus issues (that can be observed in the wpfui gallery). 1. On launching ContentDialog focus is not on content dialog, it stays on the background controls. 2. One can tab off the ContentDialog controls onto background controls.

Issue Number: N/A

What is the new behavior?

It now behaves like WinUI 3 - i.e. it has focus starting on the ContentDialog and one cannot tab off ContentDialog (it cycles within the dialog). Note that there was an attempt to Focus() dialog on load, but since ContentDialog was not set to focusable that call returned false (and did nothing). This is now fixed.

Other information

This is just a candidate solution. If one does not want ContentDialog set to Focusable for whatever reason, then they can write a routine to select the first focusable child.

@pomianowski
Copy link
Copy Markdown
Member

It looks almost too elegantly simple, thanks for your support @jackBonadies

@pomianowski pomianowski merged commit 4c4e6a9 into lepoco:development Feb 5, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants