Skip to content

Commit

Permalink
ref
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Aug 20, 2024
1 parent 50ebcfe commit 3cc690c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/js/term/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ export function trapFocus(element: HTMLElement) {
const firstFocusableElement = focusableElements[0];
const lastFocusableElement = focusableElements[focusableElements.length - 1];

if(firstFocusableElement){
console.log('test12333333');
if (firstFocusableElement) {
firstFocusableElement.focus();
}

Expand All @@ -232,11 +231,9 @@ export function trapFocus(element: HTMLElement) {
lastFocusableElement.focus();
e.preventDefault();
}
} else {
if (document.activeElement === lastFocusableElement) {
firstFocusableElement.focus();
e.preventDefault();
}
} else if (document.activeElement === lastFocusableElement) {
firstFocusableElement.focus();
e.preventDefault();
}
});
}

0 comments on commit 3cc690c

Please sign in to comment.