Block editor: deprecate ObserveTyping and integrate it in the block editor#31280
Block editor: deprecate ObserveTyping and integrate it in the block editor#31280
Conversation
|
Size Change: -18 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
| /* 3. */ | ||
| <BlockList className="getdavesbe-block-editor__block-list" /> | ||
| </ObserveTyping> | ||
| <WritingFlow> /* 2. */ |
There was a problem hiding this comment.
Maybe! I've been thinking about this one and there's several things I'd like to change here. The focus capture element should ideally render outside the iframe as well.
youknowriad
left a comment
There was a problem hiding this comment.
There is one issue here and it's also something we'll have if/when we try to do the same for writing flow: Post title.
You can right now, start typing in the title and have the flag persisted when you move to blocks I think. It's probably more visible with writing flow. That Post Title not being a block has always been some kind of edge case, so I wonder if we should duplicate the behavior there instead but again, the PostTitle component can be rendered anywhere.
|
I'll check if it's an issue for the typing observer, but I thought it wouldn't since the title doesn't have a block toolbar. If it is, maybe we can add the hook there. |
|
Sure, typing in the title now doesn't set the |
|
Done in #53875 |
Description
This reduces the verbosity of implementing a block editor, but most of all for an iframed block editor that needs extra handlers on the iframe.
It also makes sense to build this in because the typing state is strongly tied to the block list.
The only reason I can think of to leave it outside the block list is to disable hiding the toolbar, but that doesn't make much sense if you have a floating toolbar, and in case of a fixed toolbar, tying wouldn't hide it anyway. If we do want to allow disabling it, we could add a block editor setting instead.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.jsfiles for terms that need renaming or removal).