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

Modal dialogs need keyboard focus management #10754

Open
3 tasks done
steverep opened this issue Dec 1, 2021 · 8 comments · Fixed by #12724, #11999, #11730, #11710 or #11676
Open
3 tasks done

Modal dialogs need keyboard focus management #10754

steverep opened this issue Dec 1, 2021 · 8 comments · Fixed by #12724, #11999, #11730, #11710 or #11676
Assignees
Labels
Accessibility Related to accessibility for people with disabilities no-stale

Comments

@steverep
Copy link
Member

steverep commented Dec 1, 2021

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

For nearly all modal dialogs I can think of, the keyboard focus does not transfer to the dialog as it should for accessibility. I need to to click or space bar once to get the focus inside the dialog to be able to read it with a screen reader. Furthermore, after closing a dialog with escape or button, keyboard focus is transferred all the way back to the beginning of the page DOM, instead of back to the button which opened the dialog as expected.

Describe the behavior you expected

In general, these dialogs should all follow the modal dialog design pattern in the W3C ARIA Authoring Practices. These design patterns have detailed notes on managing keyboard focus.

Steps to reproduce the issue

For example, I might go to Configuration → Entities and:

  1. Click on an entity to get it's settings dialog, and then click again to read it

  2. Click the control button to get that dialog, then have to click again to read it

  3. Click the attributes button, then have to click again to read them

  4. Hit escape to get out, then have to navigate back to where I started

...
For example, I might go to Configuration → Entities and:

  1. Click on an entity to get it's settings dialog, and then click again to read it
  2. Click the control button to get that dialog, then have to click again to read it
  3. Click the attributes button, then have to click again to read them
  4. Hit escape to get out, then have to navigate back to where I started

What version of Home Assistant Core has the issue?

Any

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Firefox & Chrome (latest stable)

Which operating system are you using to run this browser?

Windows 10

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

I suspect that the cause of this may be also causing lots of other "double action" keyboard issues throughout the UI, but I figured I'd keep this issue tight and to the point rather than jumping to that conclusion.

@steverep steverep added the Bug Current Bug in UI - Extra Attention label Dec 1, 2021
@spacegaier spacegaier added the Accessibility Related to accessibility for people with disabilities label Dec 14, 2021
@steverep
Copy link
Member Author

steverep commented Feb 2, 2022

I'm starting to work on this issue, and figured out the cause of another minor issue in the process. Every time a dialog opens, my screen reader tells me it's a "true dialog" which is annoying.

ha-dialog extends the class from the material components, hacks in a custom heading, and every instance sets .heading=${true} to make sure it renders. What is missed is that the dialog is aria-labeledby that heading, so screen reader users get the unintended consequence of hearing it's a "true dialog" instead of a useful label.

On another aside, I filed this issue for the mwc-dialog component: material-components/material-web#3095.

@bramkragten
Copy link
Member

Thanks for the heads up about the heading! I'll fix that.

@steverep
Copy link
Member Author

I'm noticing a common issue among the "hassio" dialogs. None of them hide the sidebar - neither visually nor programmatically. Should probably fix that as part of this issue too.

@steverep
Copy link
Member Author

@bramkragten so far each dialog you've converted to using ha-form is just reintroducing this issue again...

  • Zone detail
  • Lovelace dashboard detail
  • Lovelace resource detail

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 10, 2022
@steverep
Copy link
Member Author

Still have more dialogs to fix

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 25, 2023
@steverep steverep removed the stale label Nov 28, 2023
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 26, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
@steverep steverep reopened this Mar 5, 2024
@steverep steverep added no-stale and removed Bug Current Bug in UI - Extra Attention stale labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment