Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions-bot committed Jan 10, 2024
1 parent 0948eaf commit 8ab18a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inline-module-9e804879e37a77d0185feb25684c241c.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,12 @@ class Trap {

const addition = this.tabDirection === 'forward' ? 1 : -1;

let count = 0;
while(true) {
if (count >= tabbableElements.length) {
break
}

if (currentFocusIndex + addition >= tabbableElements.length) {
currentFocusIndex = 0;
} else if (currentFocusIndex + addition < 0) {
Expand Down Expand Up @@ -552,9 +557,11 @@ class Trap {
this.currentFocus?.focus({ preventScroll: this.preventScroll });

// @ts-expect-error
if ([...activeElements()].includes(this.currentFocus)) {
if (![...activeElements()].includes(this.previousFocus)) {
break
}

count++;
}
}

Expand Down

0 comments on commit 8ab18a7

Please sign in to comment.