Skip to content

Commit

Permalink
docs(ui-menu): target prop support for MenuItem
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Aug 7, 2024
1 parent 8c61905 commit bb031b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/ui-menu/src/Menu/MenuItem/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ type MenuItemOwnProps = {
* Value of the `href` prop that will be put on the underlying DOM element.
*/
href?: string
/**
* Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
*/
target?: string
}

type PropKeys = keyof MenuItemOwnProps
Expand Down Expand Up @@ -115,7 +119,8 @@ const propTypes: PropValidators<PropKeys> = {
as: PropTypes.elementType, // eslint-disable-line react/require-default-props
type: PropTypes.oneOf(['button', 'checkbox', 'radio', 'flyout']),
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
href: PropTypes.string
href: PropTypes.string,
target: PropTypes.string,
}

const allowedProps: AllowedPropKeys = [
Expand All @@ -132,7 +137,8 @@ const allowedProps: AllowedPropKeys = [
'as',
'type',
'value',
'href'
'href',
'target'
]
type MenuItemState = {
selected: boolean
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-menu/src/Menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Example extends React.Component {
mountNode={() => document.getElementById('main')}
>
<Menu.Item value="mastery">Learning Mastery</Menu.Item>
<Menu.Item href="https://instructure.github.io/instructure-ui/">Default (Grid view)</Menu.Item>
<Menu.Item href="https://instructure.github.io/instructure-ui/" target="_blank">Default (Grid view)</Menu.Item>
<Menu.Item disabled>Individual (List view)</Menu.Item>
<Menu label="More Options">
<Menu.Group
Expand Down

0 comments on commit bb031b3

Please sign in to comment.