Skip to content

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

Closed

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

Activity

  1. added
    General Interface
    on Jan 11, 2022
  2. ddryo commented on Jan 25, 2022

    @ddryo
    Contributor

    I can still reproduce it with 5.9-RC4.

  3. t-hamano commented on Feb 3, 2023

    @t-hamano
    ContributorAuthor

    I have checked this issue again and the block sidebar is now split by tabs, e.g. #45005. Also, in #47105, the styles slot has been added, so this problem should not occur. I would therefore like to close this issue.

    inspectorcontrol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    General Interface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions