Skip to content

Padding UI can persist on save #31839

@ajlende

Description

@ajlende

Description

The padding/margin UI is being stored in the block attributes under style.visualizers, so if you save while hovered over the padding input, the UI persists upon reloading.

<!-- wp:cover {"url":"https://placekitten.com/500/500","id":1,"align":"center","style":{"spacing":{"padding":{"top":"128px","right":"128px","bottom":"128px","left":"128px"}},"visualizers":{"padding":{"top":true,"right":true,"bottom":true,"left":true}}}} -->
<div class="wp-block-cover aligncenter has-background-dim" style="padding-top:128px;padding-right:128px;padding-bottom:128px;padding-left:128px">
  <img class="wp-block-cover__image-background wp-image-1" alt="" src="https://placekitten.com/500/500" data-object-fit="cover"/>
  <div class="wp-block-cover__inner-container">
    <!-- wp:spacer -->
    <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
    <!-- /wp:spacer -->
  </div>
</div>
<!-- /wp:cover -->

Step-by-step reproduction instructions

  1. Create a cover block
  2. Add some padding
  3. While hovering on the padding input, save the document with the save shortcut, command+s/control+s
  4. Reload the page

Screen recording

padding-ui-persist-on-save

Metadata

Metadata

Assignees

Labels

[Block] CoverAffects the Cover Block - used to display content laid over a background image[Status] In ProgressTracking issues with work in progress[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