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

Appender element in non-edited, placed reusable blocks #20558

Closed
strarsis opened this issue Feb 29, 2020 · 5 comments
Closed

Appender element in non-edited, placed reusable blocks #20558

strarsis opened this issue Feb 29, 2020 · 5 comments
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended

Comments

@strarsis
Copy link
Contributor

Describe the bug
The appender element (with block-list-appender class) is added to placed, reusable blocks that aren't even currently edited. This results in a transparent vertical space at the bottom of the reusable block, which causes visual vertical gaps between blocks.

To reproduce
Steps to reproduce the behavior:

  1. Insert a new block, make it reusable or place a reusable block.
  2. Notice that there is now a visual space at the bottom of that reusable block. Upon careful inspection of the elements inside the reusable block, one notices it is the appender element.

Expected behavior
The appender element in a reusable block is only inserted/displayed when it is actually added (where it makes sense).

@jorgefilipecosta jorgefilipecosta added [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Mar 1, 2020
@adamziel
Copy link
Contributor

adamziel commented Mar 2, 2020

I have tested this and discovered there is in fact some vertical spacing between the reusable blocks and other blocks. However, the appender block remains invisible. The root source of the problem is WritingFlow component which nested in reusable blocks. It has display CSS property set to flex, which breaks collapsing the margin-top from the bottom block into margin-bottom of the top block. Once display: flex is removed, the spacing is gone.

Before:

image

After:

image (1)

The question here is - is this extra spacing intentional? Should it be there? I'll needs design feedback so we can get more input

@draganescu draganescu added Needs Design Feedback Needs general design feedback. and removed Needs Testing Needs further testing to be confirmed. labels Mar 2, 2020
@strarsis
Copy link
Contributor Author

strarsis commented Mar 2, 2020

@adamziel: When the appender element is hidden (of unedited blocks) using CSS,
empty space below the block is disappearing, you can try this yourself by adding these styles:

.components-disabled .block-list-appender {
  display: none;
}

@adamziel
Copy link
Contributor

adamziel commented Mar 4, 2020

@strarsis The extra spacing is definitely there:

Zrzut ekranu 2020-03-4 o 11 45 22

When I inspect the appender, it looks like this:

Zrzut ekranu 2020-03-4 o 11 47 18

However, adding the CSS rule doesn't seem to fix it:

Zrzut ekranu 2020-03-4 o 11 47 58

I even tried removing all appender elements but no dice as well. Only when I remove display: flex from .block-editor-writing-flow the extra spacing disappears as vertical margins are getting collapsed into previous and next blocks:

Zrzut ekranu 2020-03-4 o 11 48 28

Hence I wonder, if it was added intentionally to indicate that reusable block is different from other blocks. For example, when I select it, here's how it looks like:

Zrzut ekranu 2020-03-4 o 11 52 44

Design feedback appreciated!

@strarsis
Copy link
Contributor Author

Does this PR fix this issue? It seems to be related?

@noisysocks
Copy link
Member

This seems OK to me now.

Not selected:

Screen Shot 2020-04-21 at 14 14 24

Selected:

Screen Shot 2020-04-21 at 14 14 27

There's some extra padding at the top when the block is selected but I think this is desirable as it creates spacing in between the reusable block toolbar and the reusable block content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants