Skip to content

Commit

Permalink
fix(uishell): close HeaderMenu on blur
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg McLean authored and Greg McLean committed Jan 10, 2020
1 parent 3de43bb commit fb7f97b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react/src/components/UIShell/HeaderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ class HeaderMenu extends React.Component {
handleOnBlur = event => {
// Rough guess for a blur event that is triggered outside of our menu or
// menubar context
if (!event.relatedTarget) {
this.setState({ expanded: false, selectedIndex: null });
if (
event.relatedTarget &&
event.relatedTarget.getAttribute('role') !== 'menuitem'
) {
return;
}

this.setState({ expanded: false, selectedIndex: null });
};

/**
Expand Down

0 comments on commit fb7f97b

Please sign in to comment.