WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.23k stars 4.08k forks source link

Spacing Block Support allows extremely large padding values causing overflow #31773

Open stacimc opened 3 years ago

stacimc commented 3 years ago

Description

The spacing block support allows the user to enter arbitrarily large values for padding, which does not respect width or max-width set on the block and can cause the block to overflow the page.

Step-by-step reproduction instructions

  1. Create a new post and insert a Cover block.
  2. In the Inspector Controls, open the Spacing panel, enter a very large number in the Padding input (99999), and hit Enter.

Expected behaviour

The block should not exceed the width of the page.

Actual behaviour

There is no maximum amount of padding, and the block becomes extremely large and overflows the page.

Screenshots or screen recording (optional)

Screen Shot 2021-05-12 at 4 32 48 PM

Note the horizontal scrollbar.

Code snippet (optional)

WordPress information

Device information

Quintis1212 commented 3 years ago

Hi @stacimc ) I will try to fix this bug )

Quintis1212 commented 3 years ago

I created PR to fix this bug - https://github.com/WordPress/gutenberg/pull/32131

skorasaurus commented 1 month ago

This is applicable to all core blocks that have the spacing support; not just cover block; able to reproduce in gutenberg 18.6 with a group block.