-
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
Bundle ObserveTyping within the BlockList component #53875
Conversation
@@ -217,7 +217,6 @@ export default function VisualEditor( { styles } ) { | |||
ref, | |||
useClipboardHandler(), | |||
useTypewriter(), | |||
useTypingObserver(), |
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.
In the post editor, this hook was wrapping both the block list and the post title, now that this behavior is bundled for the block list, I kept it here around the post title.
Size Change: +72 B (0%) Total Size: 1.51 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.
The code changes looked good, and worked well on my tests 👍
Related #53874
What and why?
Gutenberg can be used as a platform/framework to build block editors. Mainly thanks to the @wordpress/block-editor package. That said, the experience today is not as straightforward as it can be. There can be a lot of small gotchas and hacks you need to do in order to achieve the desired result. One of these small things is the need to manually render
ObserveTyping
wrapper around theBlockList
component, this PR tries to bundle this behavior within the block list, that way custom block editors don't have to render this extra component.Testing Instructions
1- e2e tests should cover this for the post editor but you can try typing in the post editor or widgets editor or any block editor and the block toolbar should hide itself when you type and reappear as soon as you start moving the mouse.