Improve focusable element handling

pull/4827/head
navedqb 2023-11-15 23:47:20 +05:30
parent 1ae9ef3ac3
commit 186e91b811
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', {
: DomHandler.getFirstFocusableElement(el, this.getComputedSelector(el.$_pfocustrap_focusableselector)) : DomHandler.getFirstFocusableElement(el, this.getComputedSelector(el.$_pfocustrap_focusableselector))
: DomHandler.getFirstFocusableElement(_el); : DomHandler.getFirstFocusableElement(_el);
return ObjectUtils.isNotEmpty(focusableElement) ? focusableElement : findNextFocusableElement(_el.nextSibling); return ObjectUtils.isNotEmpty(focusableElement) ? focusableElement : _el.nextSibling ? findNextFocusableElement(_el.nextSibling) : null;
}; };
DomHandler.focus(findNextFocusableElement(mutation.nextSibling)); DomHandler.focus(findNextFocusableElement(mutation.nextSibling));