diff --git a/components/lib/focustrap/FocusTrap.js b/components/lib/focustrap/FocusTrap.js index 0c9968906..44f984449 100644 --- a/components/lib/focustrap/FocusTrap.js +++ b/components/lib/focustrap/FocusTrap.js @@ -40,7 +40,7 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', { : DomHandler.getFirstFocusableElement(el, this.getComputedSelector(el.$_pfocustrap_focusableselector)) : DomHandler.getFirstFocusableElement(_el); - return ObjectUtils.isNotEmpty(focusableElement) ? focusableElement : _el.nextSibling ? findNextFocusableElement(_el.nextSibling) : null; + return ObjectUtils.isNotEmpty(focusableElement) ? focusableElement : _el.nextSibling && findNextFocusableElement(_el.nextSibling); }; DomHandler.focus(findNextFocusableElement(mutation.nextSibling));