Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.trySetMenuOpen(false, e, () => focusAsync(this.itemRef.current))
} else {
export const focusMenuItem = (menuRef: HTMLElement, order: 'first' | 'last') => {
const element =
order === 'first'
? getFirstFocusable(menuRef, menuRef.firstElementChild as HTMLElement, true)
: getLastFocusable(menuRef, menuRef.lastElementChild as HTMLElement, true)
focusAsync(element)
}
this.trySetMenuOpen(false, e, () => {
focusAsync(this.itemRef.current)
})