Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
t-hamano opened this issue Jan 11, 2022 · 2 comments
Closed
Labels
General Interface Parts of the UI which don't fall neatly under other labels.

Comments

@t-hamano
Copy link
Contributor

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

@Mamaduka Mamaduka added the General Interface Parts of the UI which don't fall neatly under other labels. label Jan 11, 2022
@ddryo
Copy link
Contributor

ddryo commented Jan 25, 2022

I can still reproduce it with 5.9-RC4.

@t-hamano
Copy link
Contributor Author

t-hamano commented Feb 3, 2023

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

@t-hamano t-hamano closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

No branches or pull requests

3 participants