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

Allow keyboard focus on TeachingTip Action or Close buttons #2822

Open
LDS2020 opened this issue Jul 3, 2020 · 7 comments
Open

Allow keyboard focus on TeachingTip Action or Close buttons #2822

LDS2020 opened this issue Jul 3, 2020 · 7 comments
Assignees
Labels
area-TeachingTip feature proposal New feature proposal team-Controls Issue for the Controls team

Comments

@LDS2020
Copy link

LDS2020 commented Jul 3, 2020

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

  • On Windows it is not a big deal for the user to move the pointer to the TeachingTip (or touch it on touch capable devices) and click the Action or Close button but on Xbox, where MouseMode is disabled (which is Microsoft's recommended mode) the user may have a hard time getting to the TeachingTip as they may need to "tab" through many controls to get to it. This is a bad UI experience especially when TeachingTips may be displayed the first time the user launches the app
  • There may be other users with accessibility issues who cannot use a mouse or touch for some reason, where it may be difficult to dismiss the TeachingTip

Scope

  • when logical focus is given to a TeachingTip, pass keyboard focus to 1) any Action button, 2) the close button.
  • Currently TeachingTip can receive focus but do not get keyboard focus
Capability Priority
This proposal will allow end users to EASILY dismiss TeachingTips in environments where a mouse or touch may not be available

Open Questions

@LDS2020 LDS2020 added the feature proposal New feature proposal label Jul 3, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jul 3, 2020
@StephenLPeters
Copy link
Contributor

StephenLPeters commented Jul 6, 2020

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.

@msft-github-bot msft-github-bot removed the needs-triage Issue needs to be triaged by the area owners label Jul 6, 2020
@StephenLPeters StephenLPeters added area-TeachingTip team-Controls Issue for the Controls team labels Jul 6, 2020
@StephenLPeters
Copy link
Contributor

@SavoySchuler FYI.

@LDS2020
Copy link
Author

LDS2020 commented Jul 7, 2020

@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.

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jul 7, 2020
@StephenLPeters StephenLPeters reopened this Jul 7, 2020
@StephenLPeters
Copy link
Contributor

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?

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Jul 7, 2020
@LDS2020
Copy link
Author

LDS2020 commented Jul 8, 2020

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:

  1. when you launch the app for the first time and there is certain critical information to share, I would want the TT to be modal and the user to hit the Action or Close button to dismiss it.
  2. after the first launch during general use of the app, you could have TT be displayed at certain points (like more sophisticated ToolTips) and in that case they should support light-dismiss

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).

@StephenLPeters
Copy link
Contributor

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.

@alcail
Copy link

alcail commented Nov 5, 2022

This is an a11y issue we are currently encountering in our Windows app using WinUI 2.
The F6 shortcut is not intuitive at all and users are expecting to access the Close or Action button through Tab key, as it's supposed to be with any button.
Like LDS2020 were saying, we can't use Focus() method to force the focus on our side as the Close or Action button are not exposed, so no possibility to find them at all.
We can't even remove or collapse the Close button to replace it by our own...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TeachingTip feature proposal New feature proposal team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

5 participants