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
TINY-9337: Remove focusing after toggling the toolbar #8272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to be really careful when removing focus calls. Remember, that the editor needs to be completely keyboard accessible. If you remove this focus, then a keyboard user can't start navigating inside the floating toolbar more section once they open it with an <enter>
key.
Similarly, you need to check that pressing <escape>
inside the floating toolbar section will close the section and focus the triggering button. It seems this is still working, because it is probably being done by something else as well ... but would that mean that when closing skip_focus
is being ignored?
You'll also need to update the test: modules/alloy/src/test/ts/browser/ui/button/FloatingToolbarButtonTest.ts
. It looks like it should probably have another test to explicitly check focus has transferred into the floating section after being opened (by the keyboard or mouse), to more clearly identify that this is a requirement.
-- In terms of how to fix this
Ultimately, we might need a different code path for a "silent" trigger of the menu, so that it doesn't impact when the user actually triggers it via a keyboard or mouse, but that's just a thought.
I'm with @ephox-mogran this probably need to be that harder path of supporting the |
I was thinking about an additional parameter too. We do have a couple of callbacks which react to |
7fdbe5e
to
41cd028
Compare
@ephox-mogran @spocke Updated the PR with the additional |
modules/tinymce/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerToggleTest.ts
Show resolved
Hide resolved
modules/tinymce/src/themes/silver/main/ts/ui/general/OuterContainer.ts
Outdated
Show resolved
Hide resolved
modules/alloy/src/main/ts/ephox/alloy/api/ui/FloatingToolbarButton.ts
Outdated
Show resolved
Hide resolved
modules/alloy/src/main/ts/ephox/alloy/api/ui/FloatingToolbarButton.ts
Outdated
Show resolved
Hide resolved
modules/alloy/src/main/ts/ephox/alloy/api/ui/FloatingToolbarButton.ts
Outdated
Show resolved
Hide resolved
modules/alloy/src/main/ts/ephox/alloy/api/ui/FloatingToolbarButton.ts
Outdated
Show resolved
Hide resolved
ddf041f
to
a8afe98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok? If morgan is happy I'm happy (so I'm not approving, since I won't be around to follow up for 3 weeks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things, but I'll approve it.
The singleton will bite us, though :P
modules/alloy/src/main/ts/ephox/alloy/api/ui/SplitFloatingToolbar.ts
Outdated
Show resolved
Hide resolved
modules/tinymce/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerToggleTest.ts
Outdated
Show resolved
Hide resolved
d7dac2d
to
6234a99
Compare
Related Ticket: TINY-9337
Description of Changes:
FloatingToolbarButton
.The focusing was added in the initial
FloatingToolbarButton
commit in 2019. I am not sure what are the consequences of removing it, but it definitely conflicts withskip_focus
argument inexecCommend
.Other solutions would be to refactor the
execCommand
in order to pass downskip_focus
argument to all commands, but that feels like a major public API change.Pre-checks:
feature/
,hotfix/
orspike/
Review:
GitHub issues (if applicable):