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

Make the padding between blocks clickable to select the blocks #13723

Closed
jasmussen opened this issue Feb 7, 2019 · 10 comments
Closed

Make the padding between blocks clickable to select the blocks #13723

jasmussen opened this issue Feb 7, 2019 · 10 comments
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Inserter The main way to insert blocks using the + button in the editing interface Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

Extracting from / inpsired by #13695.

In between every block, the sibling inserter (a.k.a. "inbetweenserter" or "appender") sits. This is full-wide, and takes up the full padding between two blocks, even though only the button in the center is clickable. This is because when you hover the area between the full blocks, we surface the plus in the middle to indicate where to click.

But this also means clicking this padding in between blocks doesn't do anything, because the big bar intended to capture the hover also captures that click. Here's a GIF that explains what's going on:

padding

The transparent blue is the hoverable area that shows the plus in the middle.

The coral is the full block, including the 14px padding that surrounds every block.

Can we make it so clicking this padding even above and below blocks selects the parent block, AND surfaces the sibling inserter? I.e. could we propogate the click through this appender to select the block below?

@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. Needs Technical Feedback Needs testing from a developer perspective. labels Feb 7, 2019
@m-e-h
Copy link
Member

m-e-h commented Feb 8, 2019

I've struggled trying to select hr blocks . I think this would help.

@talldan
Copy link
Contributor

talldan commented Feb 15, 2019

Related - #12163.

It seems as though it used to be possible to click that region.

@gziolo
Copy link
Member

gziolo commented May 24, 2019

It would also help to solve #12577 - HTML block is hard to select as well.

@gziolo gziolo removed the Needs Technical Feedback Needs testing from a developer perspective. label May 24, 2019
@gziolo
Copy link
Member

gziolo commented May 24, 2019

@jasmussen, I don't think this is constrained on the technical considerations. It's all pure design decision. I personally would be fine with having two DOM elements on top of each other. One which exists only to trigger the hover effect but propagates clicks to the layer below. The second which is the inserter button or a bit wider area to make it easier to click.

@gziolo gziolo added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Blocks Overall functionality of blocks labels May 24, 2019
@jasmussen
Copy link
Contributor Author

It's all pure design decision. I personally would be fine with having two DOM elements on top of each other. One which exists only to trigger the hover effect but propagates clicks to the layer below. The second which is the inserter button or a bit wider area to make it easier to click.

I'm having a bit of difficulty parsing this, can you elaborate? Reading this it seems like you are describing what is in place already today. We have a containing div that spans the width of the main column, called block-editor-block-list__insertion-point-inserter. This div exists to show the plus button in the center, and that plus button is called block-editor-inserter. The "only" piece missing here is the code to propogate clicks on block-editor-block-list__insertion-point-inserter to whatever is below it. Do you have a simple fix for it? I'd approve in a heartbeat!

@gziolo
Copy link
Member

gziolo commented May 24, 2019

The "only" piece missing here is the code to propogate clicks on block-editor-block-list__insertion-point-inserter to whatever is below it. Do you have a simple fix for it? I'd approve in a heartbeat!

Yes, exactly. We only miss that part :)

@gziolo gziolo added Needs Dev Ready for, and needs developer efforts Good First Issue An issue that's suitable for someone looking to contribute for the first time labels May 24, 2019
@aduth
Copy link
Member

aduth commented May 28, 2019

Related - #12163.

It seems as though it used to be possible to click that region.

Is it duplicate?

@gziolo
Copy link
Member

gziolo commented May 28, 2019

Yes, it’s duplicate. One of them should be closed.

@aduth
Copy link
Member

aduth commented May 29, 2019

For additional context, I'm copying @ktmn's comment from the now-closed #12163 :

Describe the bug
You can no longer activate a block when clicking in the green area indicated on the image:

Video of current Frontenberg (Gutenberg 4.5.0):

cantselect

Can only select a paragraph by clicking on the rich text directly.

Video of Gutenberg 4.1.1:

canselect

Could select the paragraph by clicking whereever the blue border hover effect appears.

In some nested block scenarios there is very little area available to click to select a "parent" block:

forcing the use of Block Navigation item in the top toolbar, which is somewhat cumbersome for a simple goal.

Additional context

Likely a regression of #11018

More info at #11357 (comment)

@youknowriad
Copy link
Contributor

I think this is addressed now. Let me know if you think otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Inserter The main way to insert blocks using the + button in the editing interface Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants