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

Accessibility: Fix the issue when focus is moved to the post title from More Menu #16874

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Aug 2, 2019

Description

Last bug fix which finally resolves #15501. Most of the work has been merged with #14851.

Clicking on "Code Editor" or "Visual Editor" should not move focus to the post title.

The proposed solution checks whether the focus is currently at the body element which reflects the behavior when the post is initially loaded. This happens in addition to the check whether the post is empty.

We might also alternatively completely remove the autofocus behavior from the title textarea field. I'm happy to refine the logic if this is the preferred way.

How has this been tested?

  1. Open a new post.
  2. Open More Menu.
  3. Clicking on "Code Editor" or "Visual Editor" should not move focus to the post title.

Screenshots

title-auto-focus

Types of changes

Bugfix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@gziolo gziolo added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [a11y] Keyboard & Focus labels Aug 2, 2019
@gziolo gziolo self-assigned this Aug 2, 2019
@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Aug 2, 2019
Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

LGTM thanks @gziolo !

Will create a new issue to determine what should happen when using the keyboard shortcut (on a mac, it's: Shift Option Cmd M)

@gziolo
Copy link
Member Author

gziolo commented Aug 5, 2019

Will create a new issue to determine what should happen when using the keyboard shortcut (on a mac, it's: Shift Option Cmd M)

Yes, I didn't think about it. It's all tricky :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toolbar More menu: focus loss and different behavior between WP 5.2 and master versions
2 participants