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

update to focus placement for modal dialogs #3214

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

alastc
Copy link
Contributor

@alastc alastc commented May 25, 2023

Closes #518 by adding some more details around focus handling, both inside dialogs and where the triggers for a dialog no longer exist with the dialog closes.

See a preview diff

@alastc alastc requested a review from fstrr May 25, 2023 17:45
@@ -23,14 +24,14 @@ <h3>Setting focus to the document after dismissing a menu embedded on the page</
<p>Activate the trigger control via the keyboard.</p>
<ul>
<li>Check whether focus is in the menu or dialog.</li>
<li>Check whether advancing the focus in the sequential navigation order puts focus in the menu or dialog.</li>
<li>Check whether moving the focus forwards once in the sequential navigation order puts focus in the menu or dialog.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking of dialogs with no interactive content apart from the close icon. When focus is set here on opening, it is often not easy to see since there is no other focus position to go to - in effect you can either press enter or ESC to close. In these situations the second check would not work. Not sure if this edge case (not too infrequent though) needs to be covered...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "check" may not necessarily be a visual check. an auditor may also just check document.activeElement.

<ul>
<li>Check whether focus is on the trigger control.</li>
<li>Check whether advancing the focus backwards in the sequential navigation order puts focus in the trigger control.</li>
<li>Check whether moving the focus backwards once in the sequential navigation order puts focus in the trigger control.</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"focus in" > "focus on" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be said in less technical language?

techniques/failures/F85.html Outdated Show resolved Hide resolved
@fstrr fstrr changed the title Frances' proposed response update to focus placement for modal dialogs Oct 11, 2024
@alastc
Copy link
Contributor Author

alastc commented Oct 11, 2024

Noting the latest comment on the thread, it seems we need another clause for each as otherwise the failure is stricter than the normative text.

@fstrr
Copy link
Contributor

fstrr commented Oct 11, 2024

Revisiting this, there needs to be more updates to the document to spruce up the commentary on DHTML elements. There's also a couple of comments in the PR that need addressing. I'll take a crack at it.

@patrickhlauke
Copy link
Member

a slight concern overall that the "see if you tab forward or back gets you where you'd expect" test may miss situations where browser/AT error-correct for lost/reset focus (when document.activeElement goes back to body), which then fails only in certain cases (like Chrome/JAWS for instance, where the focus then goes right back to the first element in the document)

Copy link

netlify bot commented Oct 18, 2024

Deploy Preview for wcag2 ready!

Name Link
🔨 Latest commit a375270
🔍 Latest deploy log https://app.netlify.com/sites/wcag2/deploys/675372438df2580008706406
😎 Deploy Preview https://deploy-preview-3214--wcag2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stevefaulkner
Copy link

stevefaulkner commented Nov 1, 2024

Revisiting this, there needs to be more updates to the document to spruce up the commentary on DHTML elements. There's also a couple of comments in the PR that need addressing. I'll take a crack at it.

have assigned to you @fstrr  and moved back to in progress

@fstrr
Copy link
Contributor

fstrr commented Nov 1, 2024

@patrickhlauke In your most recent comment, are you suggesting that the "see if you can tab forward/backwards" test should come out?

fstrr and others added 5 commits November 6, 2024 14:36
1. Remove content about pressing the Tab key to find the triggering control.
2. Add a check to allow focus to be placed on a logical other control if the triggering element has been removed from the DOM.
3. Updated the “DHTML” content.
@bruce-usab
Copy link
Contributor

Discussed on TF call 11/22. @fstrr please add bullet points or summary of what's changed, since diff implies more change than there is. Otherwise, folks on call happy with PR.

Copy link
Member

@scottaohara scottaohara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some suggestions to consider. some of these might go a bit beyond what was originally meant to change in this PR, but I think add more clarity to the updates made.

otherwise, i'm good with this update.

techniques/failures/F85.html Outdated Show resolved Hide resolved
techniques/failures/F85.html Outdated Show resolved Hide resolved
techniques/failures/F85.html Outdated Show resolved Hide resolved
techniques/failures/F85.html Outdated Show resolved Hide resolved
techniques/failures/F85.html Show resolved Hide resolved
@w3c w3c deleted a comment from scottaohara Nov 22, 2024
@fstrr
Copy link
Contributor

fstrr commented Nov 22, 2024

Summary of changes:

  1. Updated technique to address issue WCAG F85: Clarify guidance about where the focus should go when the modal dialog is closed #518 (from 2018!).
  2. Updated examples now that the dialog element is supported.
  3. Added new content to deal with focus being placed on a different control if the original isn't there any more.
  4. Reviewed in backlog taskforce meeting on 2024-11-22.
  5. Added in almost all proposed updates from @scottaohara (thanks!).

@bruce-usab
Copy link
Contributor

Discussed on call 12/6, see preview diff.

techniques/failures/F85.html Outdated Show resolved Hide resolved
techniques/failures/F85.html Outdated Show resolved Hide resolved
Copy link
Member

@scottaohara scottaohara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for pulling in so many of my suggestions. i'm good with how this ended up

Changed "the next" to just "next".  Might also be "the next item"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WCAG F85: Clarify guidance about where the focus should go when the modal dialog is closed
10 participants