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

Dynamic blocks become unselectable when aligned left or right #24653

Closed
maartenhunink opened this issue Aug 19, 2020 · 5 comments
Closed

Dynamic blocks become unselectable when aligned left or right #24653

maartenhunink opened this issue Aug 19, 2020 · 5 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Regression Related to a regression in the latest release

Comments

@maartenhunink
Copy link

When a dynamic block is aligned to the left or right, it is almost impossible to select it. This is only possible by clicking on a very narrow section right above the block. In that case the border which normal would wrap around the block, becomes a thin line above the block. Also the little toolbar is aligned all the way to the left.

I did a bit of digging and it seems like dynamic blocks add a <div class="wp-block" data-align="right"> inside of the main <div class="block-editor-block-list__block">. While the other blocks wrap that same <div class="wp-block" data-align="right"> around (outside) of the main .block-editor-block-list__block.

After changing this around for the dynamic block, it becomes selectable again and it now also shows the correct blue border/outline again.

To reproduce

  1. Add the Latest Posts block to a post
  2. Align it to the right.
  3. Click somewhere else, and try to select the Latest Posts block again

Expected behavior
After clicking on the block which is aligned to the right, the item becomes selected.

Current behavior
A block which is aligned right/left can only be selected by clicking on a thing invisible area above the block. When selected it shows a blue border above and the toolbar is all the way to the left.

Screenshots
Screenshot 2020-08-19 at 13 46 46

Editor version:

  • WordPress version: 5.5
  • Bug is present with or without latest Gutenberg installed

Desktop:

  • OSX 10.15.6
  • Firefox 79
@talldan talldan added [Type] Bug An existing feature does not function as intended CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Regression Related to a regression in the latest release and removed [Type] Bug An existing feature does not function as intended labels Aug 20, 2020
@talldan
Copy link
Contributor

talldan commented Aug 20, 2020

Thanks for reporting the issue. It seems like the block's container is collapsing to 0 height, the blue line is the block's border.

The workaround for the moment would be to select the block using the List View/Block Navigation from the top toolbar, but agreed that this is less than ideal.

@devfle
Copy link
Contributor

devfle commented Aug 20, 2020

The problem occurred with some blocks and was caused by floating and a height of 0. I have now fixed the whole thing with a clearfix and removing the height.

Is there a reason why gutenberg uses floating instead of flexbox?

@maartenhunink
Copy link
Author

By the inactivity of this bug report it seems that this bug might not be impacting everybody? Because if this happens on every install I'd assume it would have been fixed already. Are other people also seeing this bug?

@maartenhunink
Copy link
Author

This bug has been fixed for the Latest Posts block, but is still broken for non core blocks. For instance any block created with ACF. Seems to be related to this bug report: #25088

@youknowriad
Copy link
Contributor

Hey folks, I'm not able to reproduce this issue with Core blocks. Closing this in favor of #25088 for non core blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants