Skip to content
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

Block Editor: Eliminate sibling inserter dead zone #18733

Closed
aduth opened this issue Nov 25, 2019 · 2 comments · Fixed by #19719
Closed

Block Editor: Eliminate sibling inserter dead zone #18733

aduth opened this issue Nov 25, 2019 · 2 comments · Fixed by #19719
Assignees
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@aduth
Copy link
Member

aduth commented Nov 25, 2019

Previously: #16818

As seen in the image below, there are areas between two paragraph blocks wherein clicks do not register to focus one or the other block:

Before

In my mind, an ideal user interaction for clicks between two paragraphs is that it behave similar to continuous text of any other textarea, WYSIWYG, or word processor document; namely, that it place the text caret at the point closest to where the click occurred:

Before

Generalizing this to all blocks, I'd argue that the area between the borders of a block and its content should be treated effectively as its padding, and as with padding of any other focusable field, transition clicks into the field. The current behavior is more akin to margin applied on the block.

Padding vs. Margin Illustration: https://codepen.io/aduth/pen/KOmLav

This may require a rethink of how the sibling inserter behaves. Currently, there is a challenge in implementing the desired behavior because the sibling inserter is meant to be shown when hovering anywhere between two blocks, not just toward the center. If the sibling inserter is to be kept the way it is, there might need to be some implementation of a HoverableNoPointerInteraction component, which behaves like pointer-events: none; to allow a click pass-through, while still responding to hover events to allow the sibling inserter to be shown (proof-of-concept).

Alternatively, we could consider a more significant rethink or removal of the sibling inserter altogether.

@aduth aduth added [Type] Enhancement A suggestion for improvement. [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Nov 25, 2019
@ZebulanStanphill
Copy link
Member

With regard to the block border/padding thing, it should be noted that not all blocks consist of a single big text field, so moving focus straight into a text field wouldn't really make sense, in my opinion. Removing the dead zone would still be an improvement, however, since right now clicking in that area doesn't select the block under your mouse cursor like you would expect. (Clicking in the left or right area of the padding selects the block as expected, since there is no sibling inserter there.)

As for the sibling inserter itself, I proposed an overhaul to the sibling inserter several months ago in #13571 which attempts to solve the hover issue as well as other issues. I would appreciate some feedback on it.

@aduth
Copy link
Member Author

aduth commented Nov 26, 2019

With regard to the block border/padding thing, it should be noted that not all blocks consist of a single big text field, so moving focus straight into a text field wouldn't really make sense, in my opinion. Removing the dead zone would still be an improvement, however, since right now clicking in that area doesn't select the block under your mouse cursor like you would expect. (Clicking in the left or right area of the padding selects the block as expected, since there is no sibling inserter there.)

That's a good point to highlight. Admittedly, my biggest gripe with the current behavior is that the dead zone between two paragraphs breaks a flow of it feeling like a document of text. Granted, there are many other reasons why the editor is clearly not a document of text (both intentional and not), but under these conditions it seems to me an easy win for the text authoring workflow, even for a solution that only addresses the gap between paragraph blocks.

That being said, I agree with what you mention that there's no reason this can't extend to other blocks as well, at least in that clicking in these areas should use the default focus behavior (block selection).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants