Skip to content

Commit

Permalink
ActionItem.Slot: Render as MenuGroup by default (WordPress#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 and yogeshbhutkar committed Dec 18, 2024
1 parent 5325a78 commit fa9c58c
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

0 comments on commit fa9c58c

Please sign in to comment.