Skip to content

Commit

Permalink
fix(ui-shell): add check for if href exists when handling onBlur (#5352)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Black <[email protected]>
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
3 people authored Feb 17, 2020
1 parent 301f995 commit 50b14ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/components/UIShell/HeaderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ class HeaderMenu extends React.Component {
const itemTriggeredBlur = this.items.find(
element => element === event.relatedTarget
);

if (
event.relatedTarget &&
(event.relatedTarget.getAttribute('href') !== '#' || itemTriggeredBlur)
((event.relatedTarget.getAttribute('href') &&
event.relatedTarget.getAttribute('href') !== '#') ||
itemTriggeredBlur)
) {
return;
}
Expand Down

0 comments on commit 50b14ff

Please sign in to comment.