fix(SW-184): fixed implementation of useTrapFocus

This commit is contained in:
Erik Tiekstra
2024-08-26 08:09:32 +02:00
parent bdec054ecd
commit a02dcd3428
13 changed files with 324 additions and 79 deletions

View File

@@ -45,6 +45,7 @@ export function useTrapFocus(opts?: OptionsType) {
const first = tabbableElements[0]
const last = tabbableElements[tabbableElements.length - 1]
console.log(tabbableElements)
const currentActiveElement = document.activeElement
// Scope current tabs to current root element
if (isWithinCurrentElementScope([...tabbableElements, ref.current])) {