Skip to content

Order of InspectorControls panels is non-deterministic #15641

@swissspidy

Description

@swissspidy

Describe the bug

The order of panels within InspectorControls is non-deterministic and changes depending on whether you are editing an existing block or a freshly inserted one.

To reproduce
Steps to reproduce the behavior:

  1. Copy and paste ES5 example from https://developer.wordpress.org/block-editor/developers/filters/block-filters/#editor-blockedit in the console
  2. Insert a new video block and select a video right away
  3. Notice the custom panel at the top of the block toolbar
  4. De-select block and select it again
  5. Notice that the custom panel now comes after the Video Settings panel

Expected behavior
The order should always be the same so that it can be deterministic.

Otherwise this not only confuses users, it also makes it harder to target individual controls via CSS to hide them (because there is still no API for that)

Screenshots

Freshly inserted block:

Screenshot 2019-05-14 at 17 28 44

After selecting the block again:

Screenshot 2019-05-14 at 17 28 56

Desktop (please complete the following information):
Chrome 74 on macOS Mojave

Additional context

Gutenberg 5.7 RC 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DevReady for, and needs developer efforts[Feature] ExtensibilityThe ability to extend blocks or the editing experience[Feature] Inspector ControlsThe interface showing block settings and the controls available for each block[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions