Skip to content

Commit

Permalink
(editor)(fix) Append the edit-post-header-toolbar class in Navigabl…
Browse files Browse the repository at this point in the history
…eToolbar for backward compatibility with plugin GUI injections (#58154)

* Keep the `edit-post-header-toolbar` CSS class in the `NavigableToolbar` as some plugins use it to append GUIs to it

* Add comment justifying the change
  • Loading branch information
fullofcaffeine authored Jan 24, 2024
1 parent 7272192 commit 3c3e0e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ function DocumentTools( {
const shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );

return (
// Some plugins expect and use the `edit-post-header-toolbar` CSS class to
// find the toolbar and inject UI elements into it. This is not officially
// supported, but we're keeping it in the list of class names for backwards
// compatibility.
<NavigableToolbar
className={ classnames( 'editor-document-tools', className ) }
className={ classnames(
'editor-document-tools',
'edit-post-header-toolbar',
className
) }
aria-label={ toolbarAriaLabel }
shouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }
variant="unstyled"
Expand Down

1 comment on commit 3c3e0e9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 3c3e0e9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7644289129
📝 Reported issues:

Please sign in to comment.