Skip to content

Block Preview: Aspect ratio is miscalculated for patterns with a Row block when "Allow to wrap to multiple lines" is enabled  #58768

@miksansegundo

Description

@miksansegundo

What?

Reproduced in Gutenberg v17.6.3 on Chrome and Firefox, MacOS.

On the editor's pattern inserter, extra vertical padding is added to the bottom of the pattern preview of a Row block with images when "Allow to wrap to multiple lines" is enabled.

Unexpected aspect ratio Expected result
Screenshot 2567-02-07 at 16 05 01 Screenshot 2567-02-07 at 16 19 33

The issue is only reproducible when the option "Allow to wrap to multiple lines" is enabled.

Screenshot 2567-02-07 at 16 04 00

Here is a screenshot when that option is disabled:

Screenshot 2567-02-07 at 16 04 34

On Chrome, the development tools must be closed to reproduce the issue.

Screen Capture on 2567-02-07 at 16-43-45

On Firefox, the dev tools can stay open.

Screen Capture on 2567-02-07 at 16-49-31

Why?

It seems there is a bug in how the aspect ratio is calculated. Maybe a race condition?

That extra padding is not expected and can confuse users on the actual pattern height.

How?

Debugging how the aspect ratio is calculated. See

Here is the pattern markup used for testing: ```html
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Block] PatternAffects the Patterns Block[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions