Bundle ObserveTyping within the BlockList component#53875
Merged
draganescu merged 1 commit intotrunkfrom Aug 24, 2023
Merged
Conversation
youknowriad
commented
Aug 22, 2023
| ref, | ||
| useClipboardHandler(), | ||
| useTypewriter(), | ||
| useTypingObserver(), |
Contributor
Author
There was a problem hiding this comment.
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.
25 tasks
|
Size Change: +72 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
jorgefilipecosta
approved these changes
Aug 24, 2023
Member
jorgefilipecosta
left a comment
There was a problem hiding this comment.
The code changes looked good, and worked well on my tests 👍
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ObserveTypingwrapper around theBlockListcomponent, 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.