-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add setting to display rich text toolbar inline #42399
Conversation
Size Change: +179 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
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 this is working great. Left a wording suggestion to the setting. However there is something about the interaction that does not feel right when the toolbar:
- shows up below the selection (everything else is on top of the current insertion point)
- shows up alongside the block toolbar? Maybe we could hide the block toolbar when
a) this preference is on
b) text is selected
However code wise it's all 👍🏻
We do the same for the link UI. This shows below the link as well. I think this was done to not overlap with the block toolbar. |
fea3e6e
to
7df9544
Compare
I am using the Gutenberg PR build but I am not able to get the expected result. I am double clicking text and I am not seeing the inline toolbar when the word is selected. |
@paaljoachim the setting in the UI was removed, so you can't test this currently (there's probably a code snippet, but I'm not sure :D). I believe there is an intention to add the setting back and refine the UX in a subsequent PR. |
Alrighty! Thanks for the heads up James! |
It's for #41740 |
What?
Adds a setting to display the rich text toolbar inline, meaning next to selected text when there is selection.
Why?
This can be automatically enabled when distraction free writing is enabled (#41740).
This option makes sense on its own too for people that prefer this interface style. It might even make sense to do this by default in the future. The rich text button is not really useful to be display all of the time.
How?
With
useAnchorRef
it's easy to render the toolbar at the selection.Testing Instructions
Type some text. Try selecting with Shift+Alt+Arrow. The toolbar should appear. Try also selecting with the mouse.
Screenshots or screencast