diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu-test.js b/packages/react/src/components/OverflowMenu/OverflowMenu-test.js index 7235879fad81..d670e58b5a99 100644 --- a/packages/react/src/components/OverflowMenu/OverflowMenu-test.js +++ b/packages/react/src/components/OverflowMenu/OverflowMenu-test.js @@ -160,6 +160,15 @@ describe('OverflowMenu', () => { ); }); + it('fires onClick only once per button click', () => { + const mockOnClick = jest.fn(); + const rootWrapper = mount(); + + rootWrapper.find('button').simulate('click'); + + expect(mockOnClick).toHaveBeenCalledTimes(1); + }); + it('should NOT toggle state in response to Enter or Space when the menu is open', () => { const enterKey = 13; const spaceKey = 32; diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu.js b/packages/react/src/components/OverflowMenu/OverflowMenu.js index 596c68c3ea05..fa39310e553a 100644 --- a/packages/react/src/components/OverflowMenu/OverflowMenu.js +++ b/packages/react/src/components/OverflowMenu/OverflowMenu.js @@ -278,6 +278,7 @@ class OverflowMenu extends Component { } handleClick = (evt) => { + evt.stopPropagation(); if (!this._menuBody || !this._menuBody.contains(evt.target)) { this.setState({ open: !this.state.open }); this.props.onClick(evt);