-
Notifications
You must be signed in to change notification settings - Fork 683
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
Allow keyboard focus on TeachingTip Action or Close buttons #2822
Comments
I think the app developer can already put focus on any element in the teaching tip, by calling .Focus(), It is by design that we do not put focus in the teaching tip automatically, Teaching tips are supposed to be non intrusive so we don't want to pull focus into them. There is an issue which causes the teaching tip to not be added to the tab order which cannot be fixed until Winui3. There is currently code which allows the F6 key (landmark navigation) to put focus on the teaching tip's close button. Let me know if I'm not understanding the proposal, but I think that all of the tools needed for this are either available or blocked by known bugs. |
@SavoySchuler FYI. |
@StephenLPeters I have not found a way to access either the Action or Close buttons of the TT to give them .Focus() as you suggest because they are not exposed. I have explored the TT in LiveView and tried to traverse the UIElements in code but I cannot figure a way to access these Buttons. If you could share a link of code to do that, I would appreciate it. For context of the original problem, please see: https://stackoverflow.com/questions/62624973/uwp-setting-focus-on-teachingtip-programatically. In the current design TTs are difficult to use when you don't have a mouse or touch and I have not tested it with Navigator but I would expect their could be ADA Accessibility issues also if it doesn't get focus. |
I understand the issue now. I think currently you have the F6 key as a way of solving the issue, I'll admit it is not great though. If your tip has custom content in it, which is focusable, you could call .Focus() on that. If not VisualTreeHelper has a method called GetOpenPopups which you could use to find the visual tree associated with the teaching tip. This is really annoying, and I think we need to find a better solutions to this. Do you have thoughts on what a great solution would be for you? |
I will check out the GetOpenPopups method and see if that works. Unfortunately F6 would not be an option on Xbox when the user only has a controller :-) WRT to the ideal solution, I see at least two common use cases for TT:
Therefore, the default behavior would be as it works today to support light-dismiss (scenario 2) but at times where you want the user to acknowledge it (scenario 1), expose the Action and Close buttons on the TT so the developer can give it Focus and allow the user to easily dismiss it (click, touch, enter key or A/select). |
I'm pretty sure you can use XY focus to get to a teaching tip, so you should be able to use gamepad to get to the close button. Sometimes when the tip is not axis aligned with the other UI components it can be hard to get the system to do it, but if the buttons line up with other UI components it should be pretty easy. |
This is an a11y issue we are currently encountering in our Windows app using WinUI 2. |
Proposal: Allow keyboard focus on TeachingTip Action or Close buttons
Summary
Allowing apps to set keyboard focus on Action or Close buttons on TeachingTips will make it easier for users to interact with them.
Rationale
Scope
Open Questions
The text was updated successfully, but these errors were encountered: