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

Handle initial focus within snippet preview modal #10699

Closed
dariaknl opened this issue Aug 20, 2018 · 7 comments
Closed

Handle initial focus within snippet preview modal #10699

dariaknl opened this issue Aug 20, 2018 · 7 comments

Comments

@dariaknl
Copy link
Contributor

How can we reproduce this behavior?

  1. Open Snippet preview in Gutenberg in a modal.
  2. See screenshot: "Close dialog" is shown on a opening of modal though I expect to see it only when I hover over the close button

screen shot 2018-08-20 at 10 11 45

Technical info

  • WordPress version: 4.9.8
  • Yoast SEO version: 8.1 RC1
@dariaknl dariaknl added the regression Label for high-prio issue label Aug 20, 2018
@IreneStr IreneStr added the queue label Aug 20, 2018
@IreneStr IreneStr added this to the 8.1 milestone Aug 20, 2018
@IreneStr IreneStr changed the title "Close dialog" text shown on a open of Snippet preview modal Handle initial focus within snippet preview modal Aug 20, 2018
@IreneStr
Copy link
Contributor

IreneStr commented Aug 20, 2018

The focus should be on the SEO title input field. Make sure this is announced correctly by screenreaders.

@IreneStr IreneStr removed this from the 8.1 milestone Aug 23, 2018
@IreneStr IreneStr added next and removed queue labels Aug 23, 2018
@dariaknl dariaknl removed the regression Label for high-prio issue label Aug 28, 2018
@IreneStr IreneStr added queue and removed next labels Aug 28, 2018
@afercia
Copy link
Contributor

afercia commented Aug 28, 2018

The focus should be on the SEO title input field.

No, I wouldn't recommend this. There's a lot of content before the title input field that would be basically "skipped" and screen reader users may have no clue there's something before that has been skipped.

Modal dialog notes regarding initial focus placement:
https://www.w3.org/TR/wai-aria-practices/#h-note-7

Based on the rules above we could try to set initial focus on the first paragraph. However, given this is the default Gutenberg behavior, I think it should be solved upstream in Gutenberg, preserving the tooltip:

  • initial focus on the close button
  • when initial focus is set programmatically, the tooltip should not appear
  • hovering or manually focusing the close button should make the tooltip appear

@afercia
Copy link
Contributor

afercia commented Aug 28, 2018

Note: the "Close" button at the bottom is not translatable.

@dariaknl
Copy link
Contributor Author

UPD: if you open console, the bug is gone.

@afercia
Copy link
Contributor

afercia commented Aug 28, 2018

@dariaknl not arguing, it's not a bug 🙂It's just the default behavior of the Gutenberg modal. I'll open an issue upstream to take this into consideration. The fact that with the console open the tooltip doesn't appear, it's a Chrome bug in correctly handling focus 😉

@afercia
Copy link
Contributor

afercia commented Aug 28, 2018

Created WordPress/gutenberg#9410 upstream.

@IreneStr IreneStr added next and removed queue labels Aug 29, 2018
@IreneStr
Copy link
Contributor

Closing because this needs to be fixed in Gutenberg

@IreneStr IreneStr removed the next label Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants