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

Menu: use ariakit types #68206

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/components/src/menu/checkbox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const MenuCheckboxItem = forwardRef<
HTMLDivElement,
WordPressComponentProps< MenuCheckboxItemProps, 'div', false >
>( function MenuCheckboxItem(
{ suffix, children, hideOnClick = false, ...props },
{ suffix, children, disabled = false, hideOnClick = false, ...props },
ref
) {
const menuContext = useContext( MenuContext );
Expand All @@ -37,6 +37,7 @@ export const MenuCheckboxItem = forwardRef<
ref={ ref }
{ ...props }
accessibleWhenDisabled
disabled={ disabled }
hideOnClick={ hideOnClick }
store={ menuContext.store }
>
Expand Down
11 changes: 10 additions & 1 deletion packages/components/src/menu/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ export const MenuItem = forwardRef<
HTMLDivElement,
WordPressComponentProps< MenuItemProps, 'div', false >
>( function MenuItem(
{ prefix, suffix, children, hideOnClick = true, store, ...props },
{
prefix,
suffix,
children,
disabled = false,
hideOnClick = true,
store,
...props
},
ref
) {
const menuContext = useContext( MenuContext );
Expand All @@ -37,6 +45,7 @@ export const MenuItem = forwardRef<
ref={ ref }
{ ...props }
accessibleWhenDisabled
disabled={ disabled }
hideOnClick={ hideOnClick }
store={ computedStore }
>
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/menu/radio-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const MenuRadioItem = forwardRef<
HTMLDivElement,
WordPressComponentProps< MenuRadioItemProps, 'div', false >
>( function MenuRadioItem(
{ suffix, children, hideOnClick = false, ...props },
{ suffix, children, disabled = false, hideOnClick = false, ...props },
ref
) {
const menuContext = useContext( MenuContext );
Expand All @@ -44,6 +44,7 @@ export const MenuRadioItem = forwardRef<
ref={ ref }
{ ...props }
accessibleWhenDisabled
disabled={ disabled }
hideOnClick={ hideOnClick }
store={ menuContext.store }
>
Expand Down
Loading
Loading