Skip to content

Commit

Permalink
ActionItem.Slot: Render as MenuGroup by default (#67985)
Browse files Browse the repository at this point in the history
* ActionItem.Slot: Render as MenuGroup by default

* Add changelog

* Remove redundant `as` rendering in app

Co-authored-by: mirka <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
  • Loading branch information
4 people authored Dec 17, 2024
1 parent 028f72d commit 0f0f2a8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/editor/src/components/more-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default function MoreMenu() {
<ActionItem.Slot
name="core/plugin-more-menu"
label={ __( 'Plugins' ) }
as={ MenuGroup }
fillProps={ { onClick: onClose } }
/>
<MenuGroup label={ __( 'Tools' ) }>
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
) }
<ActionItem.Slot
name="core/plugin-preview-menu"
as={ MenuGroup }
fillProps={ { onClick: onClose } }
/>
</>
Expand Down
4 changes: 4 additions & 0 deletions packages/interface/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Breaking Changes

- `ActionItem.Slot`: Render as `MenuGroup` by default ([#67985](https://github.com/WordPress/gutenberg/pull/67985)).

## 8.3.0 (2024-12-11)

## 8.2.0 (2024-11-27)
Expand Down
4 changes: 2 additions & 2 deletions packages/interface/src/components/action-item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Property used to change the event bubbling behavior, passed to the `Slot` compon

### as

The component used as the container of the fills. Defaults to the `ButtonGroup` component.
The component used as the container of the fills. Defaults to the `MenuGroup` component.

- Type: `Component`
- Required: no
- Default: `ButtonGroup`
- Default: `MenuGroup`

## ActionItem

Expand Down
4 changes: 2 additions & 2 deletions packages/interface/src/components/action-item/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* WordPress dependencies
*/
import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
import { MenuGroup, Button, Slot, Fill } from '@wordpress/components';
import { Children } from '@wordpress/element';

const noop = () => {};

function ActionItemSlot( {
name,
as: Component = ButtonGroup,
as: Component = MenuGroup,
fillProps = {},
bubblesVirtually,
...props
Expand Down

1 comment on commit 0f0f2a8

@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 0f0f2a8.
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/12381455281
📝 Reported issues:

Please sign in to comment.