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

Different focus behavior when clicking the toolbar buttons #6336

Open
afercia opened this issue Apr 21, 2018 · 6 comments
Open

Different focus behavior when clicking the toolbar buttons #6336

afercia opened this issue Apr 21, 2018 · 6 comments
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@afercia
Copy link
Contributor

afercia commented Apr 21, 2018

Splitting this out from #3003

When clicking or pressing Enter on some buttons, for example the alignment buttons, focus stays on that button. Instead, when activating other buttons, for example bold/italic/strikethrough, focus is moved back to the editing area.

This is inconsistent: all buttons should behave the same. It's also different from what TinyMCE does in the classic editor, where focus is always moved back to the editing area.

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Apr 21, 2018
@afercia afercia added the Needs Design Feedback Needs general design feedback. label Sep 17, 2018
@afercia
Copy link
Contributor Author

afercia commented Sep 17, 2018

Discussed during today's accessibility bug-scrub: focus should be moved consistently. When activating these buttons, either focus should always be moved back to the content or it should say on the buttons. We're open to discuss which of the two behaviors would be better for usability and accessibility.
Note: in the Classic Editor, focus is always moved back to the content.

@tofumatt
Copy link
Member

tofumatt commented Oct 9, 2018

Not really convinced this needs design feedback, and I agree with you; this is bad for accessibility but beyond that is bad usability. This should be consistent, and always return focus to the content.

@tofumatt tofumatt removed the Needs Design Feedback Needs general design feedback. label Oct 9, 2018
@tofumatt tofumatt self-assigned this Oct 9, 2018
@tofumatt
Copy link
Member

I'm having a bit of trouble following the code path for these controls and where the reset happens.

It seems like the reset of focus is a by-product/side-effect of https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/rich-text/index.js#L448, so I'm not exactly clear on how to get the alignment controls (which are located elsewhere with different onChange events) to focus the control after being clicked.

@iseulde or someone else with more RichText knowledge than me: any chance you'd know off the top-of-your-head how to get the alignment controls to focus the block's content after interaction?

@gziolo
Copy link
Member

gziolo commented Oct 18, 2019

@ellatrix - is this something you have planned to work on?

@mtias
Copy link
Member

mtias commented Nov 17, 2019

Related #18534

@youknowriad
Copy link
Contributor

Related #17617

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).
Projects
None yet
Development

No branches or pull requests

5 participants