diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index f21b1c42ec76..ac2fb4d44855 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -4173,6 +4173,9 @@ Map { "requireTitle": Object { "type": "bool", }, + "title": Object { + "type": "string", + }, "wrapperClassName": Object { "type": "string", }, diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu-story.js b/packages/react/src/components/OverflowMenu/OverflowMenu-story.js index 86c3a1eda037..13cca7c5cd2e 100644 --- a/packages/react/src/components/OverflowMenu/OverflowMenu-story.js +++ b/packages/react/src/components/OverflowMenu/OverflowMenu-story.js @@ -77,11 +77,13 @@ export const Basic = withReadme(OverflowREADME, () => ( {...props.menuItem()} itemText="Option 2 is an example of a really long string and how we recommend handling this" requireTitle + title="Custom tooltip title" /> ` instead' ), + /** * `true` if this menu item has long text and requires a browser tooltip */ requireTitle: PropTypes.bool, + + /** + * Specify a title for the OverflowMenuItem + */ + title: PropTypes.string, + /** * The CSS class name to be placed on the wrapper list item element */ @@ -141,6 +148,7 @@ export default class OverflowMenuItem extends React.Component { wrapperClassName, requireTitle, index, + title, ...other } = this.props; @@ -193,7 +201,7 @@ export default class OverflowMenuItem extends React.Component { onKeyDown(evt); }} ref={this.overflowMenuItem} - title={requireTitle ? itemText : null} + title={requireTitle ? title || itemText : null} tabIndex="-1" index={index}> {OverflowMenuItemContent}