Skip to content

Container width and height values will cause layout issues when changing theme or updating settings.layout.contentSize value in theme.json #28

Description

@chrishbite

Expected Behavior

The Image Comparisons containerHeight and containerWidth values should avoid being set to numeric values unless specifically set by a user, this will allow for the block to scale with the themes settings.layout.contentSize value in theme.json when changed.

Actual Behavior

When an Image Comparison block is added the containerWidth attribute is set to the value of settings.layout.contentSize from the themes theme.json, if you then change theme or edit the value of settings.layout.contentSize in theme.json the Image Comparison block won't scale to the new width in the editor or on the frontend.

Step-by-step reproduction instructions

  1. Add an Image Comparison block
  2. Add both images
  3. Save
  4. Increase the settings.layout.contentSize value in theme.json
  5. Refresh page
  6. See that the Image Comparison block is now displaying incorrectly in the editor and on the frontend

Screenshots, screen recordings, code snippets

N/A

System Information

  • Browser: Firefox Developer Edition 131.0b2 (aarch64)
  • WordPress version: 6.6.1
  • PHP version: 8.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions