Skip to content

Commit

Permalink
feat(OverflowMenu): support custom closeMenu method (#7456)
Browse files Browse the repository at this point in the history
Co-authored-by: Alessandra Davila <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 19, 2021
1 parent 88aae18 commit 56bbffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class OverflowMenu extends Component {
const childrenWithProps = React.Children.toArray(children).map(
(child, index) =>
React.cloneElement(child, {
closeMenu: this.closeMenu,
closeMenu: child.props.closeMenu || this.closeMenu,
handleOverflowMenuItemFocus: this.handleOverflowMenuItemFocus,
ref: (e) => {
this[`overflowMenuItem${index}`] = e;
Expand Down

0 comments on commit 56bbffe

Please sign in to comment.