Skip to content

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

@stacimc

Description

@stacimc

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

  • WordPress version: 5.7.1
  • Gutenberg version: trunk
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: Desktop
  • Operating system: Mac Big Sur
  • Browser: Chrome 90

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Feature] LayoutLayout block support, its UI controls, and style output.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions