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

fix(dialog): Release focus after style changes on close #4069

Merged
merged 10 commits into from
Nov 21, 2018

Conversation

abhiomkar
Copy link
Collaborator

Fixes #4033

@mdc-web-bot
Copy link
Collaborator

All 655 screenshot tests passed for commit 52cd2dc vs. master! 💯🎉

@kfranqueiro
Copy link
Contributor

Testing in Safari using the catalog page against this branch, it seems like the problem isn't fully resolved. It also seems like it might be somewhat dependent on how far VoiceOver is into its announcements before you close the dialog. Even without this change, sometimes VO will automatically navigate to the top bar of the app after announcing the cancel button and dialog.

image

(The black outline is the screen reader still navigated onto the cancel button in the now-closed dialog)

Also, I don't think this change will do anything for the other issue mentioned in #4033 RE opening the confirmation or simple dialog and the screen reader not properly navigating into it?

@acdvorak acdvorak self-assigned this Nov 9, 2018
@mdc-web-bot
Copy link
Collaborator

All 655 screenshot tests passed for commit 928d848 vs. master! 💯🎉

@abhiomkar
Copy link
Collaborator Author

This change fixes Safari + VoiceOver on Mac. But doesn't fix iOS Safari + VoiceOver issue because of iOS platform limitation.

Apparently document.activeElement which is used to get the currently focused element doesn't work. I tested with this codepen example on iOS to demonstrate this bug. (But, works on Android browsers).

Workaround for this iOS issue would be to send button element selector that dialog needs to restore focus upon close instead of relying on document.activeElement as shown in ARIA Modal Dialog example. But I'm inclined towards not to optimize the solution for single platform.

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

To clarify the above point, iOS Safari isn't registering activeElement at all, hence the problem.

LGTM for desktop Safari.

@codecov-io
Copy link

codecov-io commented Nov 20, 2018

Codecov Report

Merging #4069 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4069   +/-   ##
=======================================
  Coverage   98.67%   98.67%           
=======================================
  Files         126      126           
  Lines        5603     5603           
  Branches      747      747           
=======================================
  Hits         5529     5529           
  Misses         74       74
Impacted Files Coverage Δ
packages/mdc-dialog/foundation.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 857977f...02c8f11. Read the comment docs.

@mdc-web-bot
Copy link
Collaborator

All 663 screenshot tests passed for commit 02c8f11 vs. master! 💯🎉

@abhiomkar abhiomkar merged commit e12997a into master Nov 21, 2018
@abhiomkar abhiomkar deleted the fix/dialog_focus_voiceover branch November 21, 2018 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants