Gutenberg: Selected Gallery item close control causes overflow and hoz scrollbar

Created on 29 Mar 2019  路  7Comments  路  Source: WordPress/gutenberg

When set to full width, the rightmost item within the Gallery cause a 1px hoz scrollbar to appear _when selected_. This is caused by...

<div class="block-library-gallery-item__inline-menu" />

...which has a negative offset of -2px.

To Reproduce
Steps to reproduce the behavior:

  1. Open Firefox (it's easier to see the scrollbars - Chrome appears to compensate)
  2. Install a Theme which does not enqueue editor styles
  3. Add a Gallery with 6+ images
  4. Make it full width
  5. Select the _rightmost Image_
  6. See hoz scrollbar appear on editor

Expected behavior
Should not have a hoz scrollbar

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: All
  • Browser Chrome, FF, Safari (everything really)
  • Version (unknown - likely all)

Additional context

  • Gutenberg 5.3
Good First Issue Needs Dev [Block] Gallery [Type] Bug

All 7 comments

Screenshot:

gallery-select

I can't seem to to replicate this issue. Did you already fix it?

https://media.giphy.com/media/1wPWNnhA2BxirgkXFe/200w_d.gif

@rebeccaj1211 Apologies there were some other conditions needed to replicate this issue that in my haste I forgot to add.

I've now updated the Issue with these details (see above). For your info you need to both:

  • Open Firefox (it's easier to see the scrollbars - Chrome appears to compensate)
  • Install a Theme which does not enqueue editor styles

Should be a simple fix involving tweaking the positioning of the element I reference in the description.

Just noting that this seems to have spread: Galleries in general seem to cause horizontal scrolling, even when no item has been selected:

gallery

@getdave @kjellr I just tried this in FireFox 72 and Chrome 79 and I can't reproduce this. Is this still an issue?

@getdave It looks like Galleries can't be aligned wide anymore? I was not able to reproduce the bug, would you mind double-checking when you get a chance?

Can no longer replicate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spocke picture spocke  路  3Comments

davidsword picture davidsword  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments

nylen picture nylen  路  3Comments

hedgefield picture hedgefield  路  3Comments