-
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
Sibling inserter: fix dead zone between blocks #19719
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.
I can definitely feel the improvement with this. It's a much simpler solution as well to last I explored this in #16818.
One thing I included there which I'm curious if you think would be good or not, would be to change the cursor to cursor: text;
to indicate to the user that it's an area they can click on to start typing.
I noticed something, which I'm not sure if is expected, but if you click on the dead zone twice (above a paragraph of text), then the caret becomes lost and I can no longer type:
packages/block-editor/src/components/block-list/insertion-point.js
Outdated
Show resolved
Hide resolved
…t.js Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
@aduth Thank you for the review! I can reproduce the issue you're having with the second click. The problem is that we don't render the sibling inserter above a block when it is selected to avoid clashing with the toolbar. I'm starting to thing we should either:
The first solution sounds cleaner to me. |
I'm wary to create additional event listener on the block container though, since the goal is to eventually lighten the inner blocks DOM as well. Maybe this is a good enough first version and we can revisit it separately. |
Ok, I went for the second option. This also makes it more obvious if there would be a problem with the sibling inserter displaying. |
Prior to these changes, pressing Shift+Tab from the paragraph text would focus and show the sibling inserter. It still seems to be focused, but is no longer shown. |
Prior to these changes, there was no hover interaction "above" a block to be able to click on the sibling inserter, but now it seems to be possible (it is invisible but interactable, like in #19719 (comment)). |
@aduth That's the expected position since #19596. I agree that this needs to be revisited, but it works fine for now. Ideally we have a tabbable inserter before and after the block that is displayed somewhere in the middle of the top and bottom border. It's also expected that the inserter is positioned before the block toolbar in the DOM. |
Sorry about the visible tooltip. I'll fix it in a follow up PR. |
Description
Fixes #18733.
Fixes #10648.
This PR removes the "dead zone" between blocks by handling clicks on the inserter to focus the closest element.
How has this been tested?
Screenshots
Types of changes
Checklist: