From 50b14ff8ced774585fe1162192f22356d577aaef Mon Sep 17 00:00:00 2001 From: Duy Tran Date: Mon, 17 Feb 2020 19:24:56 +0700 Subject: [PATCH] fix(ui-shell): add check for if href exists when handling onBlur (#5352) Co-authored-by: Josh Black Co-authored-by: TJ Egan --- packages/react/src/components/UIShell/HeaderMenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/UIShell/HeaderMenu.js b/packages/react/src/components/UIShell/HeaderMenu.js index fae3cde4b002..40d98c787a12 100644 --- a/packages/react/src/components/UIShell/HeaderMenu.js +++ b/packages/react/src/components/UIShell/HeaderMenu.js @@ -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; }