Skip to content

InspectorControls: Custom panel will be placed before Typegraphy panel #37845

@t-hamano

Description

@t-hamano

Description

I hooked up the editor.BlockEdit and added my own InspectorControls as follows.

const withInspectorControls = createHigherOrderComponent((BlockEdit) => {
  return (props) => {
    return (
      <>
        <BlockEdit {...props} />
        <InspectorControls>
          <PanelBody title='My Control'>My Control</PanelBody>
        </InspectorControls>
      </>
    );
  };
}, 'withInspectorControl');
addFilter('editor.BlockEdit', 'wpse', withInspectorControls);

It will be placed after all core panels, i.e. just before the Advanced panel in wordpress 5.8.3

However, for some reason, it is placed between the core panels, i.e. in front of the Typography panel in WordPress 5.9 (RC-1).

I have read the documentation and source for InspectorControls, but I could not understand why this behavior occurs.
Is there any way to place my own InspectorControls after all the core panels?

Step-by-step reproduction instructions

Please look at the code in the description.

Screenshots, screen recording, code snippet

capture

Environment info

  • WordPress 5.8.3 and 5.9 RC-1
  • Gutenberg 12.3.0(I tested both with the gutenberg plugin enabled and disabled.)

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

    General InterfaceParts of the UI which don't fall neatly under other labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions