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

Comments

@afercia
Copy link
Contributor

@afercia 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
Copy link
Contributor Author

@afercia 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 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 self-assigned this Oct 9, 2018
@tofumatt
Copy link
Member

@tofumatt tofumatt commented Oct 10, 2018

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 gziolo commented Oct 18, 2019

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

@mtias
Copy link
Contributor

@mtias mtias commented Nov 17, 2019

Related #18534

@youknowriad
Copy link
Contributor

@youknowriad youknowriad commented Nov 21, 2019

Related #17617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants