diff --git a/CHANGELOG.md b/CHANGELOG.md index 132dc05555..940a870154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Updated theming for `Attachment` for Teams, Teams Dark and Teams Contrast @bcalvery ([#1033]https://github.com/stardust-ui/react/pull/1033) - `FocusTrapZone` - Do not propagate any keyboard events @sophieH29 ([#1180](https://github.com/stardust-ui/react/pull/1180)) - Capture effect of `Esc` key down event within component for `Popup` and `Dropdown` @kuzhelov ([#1183](https://github.com/stardust-ui/react/pull/1183)) +- Fix prop types of `MenuItem` @kuzhelov ([#1197](https://github.com/stardust-ui/react/pull/1197)) - Fix example's code of `Theming Examples` guide @kuzhelov ([#1192](https://github.com/stardust-ui/react/pull/1192)) ### Features diff --git a/packages/react/src/components/Menu/MenuItem.tsx b/packages/react/src/components/Menu/MenuItem.tsx index 93d237bbb8..75a44f3c1a 100644 --- a/packages/react/src/components/Menu/MenuItem.tsx +++ b/packages/react/src/components/Menu/MenuItem.tsx @@ -23,7 +23,7 @@ import Menu from './Menu' import Box from '../Box/Box' import { menuItemBehavior, submenuBehavior } from '../../lib/accessibility' import { Accessibility, AccessibilityActionHandlers } from '../../lib/accessibility/types' -import { ComponentEventHandler, ReactProps, ShorthandValue } from '../../types' +import { ComponentEventHandler, ReactProps, ShorthandValue, ShorthandCollection } from '../../types' import { focusAsync } from '../../lib/accessibility/FocusZone' import Ref from '../Ref/Ref' @@ -105,7 +105,7 @@ export interface MenuItemProps wrapper?: ShorthandValue /** Shorthand for the submenu. */ - menu?: ShorthandValue + menu?: ShorthandValue | ShorthandCollection /** Indicates if the menu inside the item is open. */ menuOpen?: boolean @@ -168,7 +168,7 @@ class MenuItem extends AutoControlledComponent, MenuIt underlined: PropTypes.bool, vertical: PropTypes.bool, wrapper: PropTypes.oneOfType([PropTypes.node, PropTypes.object]), - menu: customPropTypes.itemShorthand, + menu: PropTypes.oneOfType([customPropTypes.itemShorthand, customPropTypes.collectionShorthand]), menuOpen: PropTypes.bool, defaultMenuOpen: PropTypes.bool, onActiveChanged: PropTypes.func,