Skip to content

Inspector Controls: Inputs aren't clearing after control is reset via panel menu  #42455

@aaronrobertshaw

Description

@aaronrobertshaw

Description

When resetting some of the more complex or compound controls via their panel's menu, their inputs aren't being cleared. This is affecting multiple controls in the Inspector Controls sidebar including padding, margin, borders and border radii etc.

A git bisect shows this regressed when #40518 landed.

Expected Behaviour

When resetting a control, its value is cleared from its field, when that field doesn't have any default value.

Actual Behaviour

When resetting the padding control, for example, its individual side controls are not cleared after resetting padding via the panel's menu

Step-by-step reproduction instructions

  1. Edit a post, add a group block and select it
  2. In the sidebar, set a padding value under Dimensions, then unlinked the control
  3. Reset the padding via the Dimensions panel's menu and note that your previous value is still displayed in the unlinked controls
  4. Link the padding control again and notice that the singular padding field is in fact empty.
  5. Unlink the fields again and note the fields are now cleared
  6. Repeat this process for padding, margin, borders, or border radius.

Screenshots, screen recording, code snippet

Screen.Recording.2022-07-15.at.4.45.06.pm.mp4

Environment info

  • WP: 6.0
  • Gutenberg: trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Feature] UI ComponentsImpacts or related to the UI component system[Package] Components/packages/components[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