5.0: Fixes bugs with menu items (#40319)

This commit is contained in:
Echo
2026-08-28 14:27:26 +00:00
committed by GitHub
parent fd70a5a926
commit c6450d4090

View File

@@ -87,6 +87,8 @@ const MenuItemBase = <As extends React.ElementType>({
return (
<Component
// If it's a button, set the type by default or it will submit forms.
type={AsComp === 'button' ? 'button' : undefined}
{...props}
data-menu-item
className={classNames(
@@ -260,7 +262,13 @@ export const MenuItemCheckbox: React.FC<MenuItemCheckboxProps> = ({
aria-checked={checked}
onClick={handleChange}
trailingContent={
<Toggle aria-hidden='true' tabIndex={-1} size='sm' checked={checked} />
<Toggle
aria-hidden='true'
tabIndex={-1}
size='sm'
checked={checked}
readOnly
/>
}
>
{children}