Skip to content

Commit

Permalink
Update focusTrap.ts (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartduisters committed Apr 7, 2023
1 parent 4306e0e commit 52a0a12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/actions/FocusTrap/focusTrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function focusTrap(node: HTMLElement, enabled: boolean) {
};
onInit();

function onDestory(): void {
function onDestroy(): void {
if (elemFirst) elemFirst.removeEventListener('keydown', onFirstElemKeydown);
if (elemLast) elemLast.removeEventListener('keydown', onLastElemKeydown);
}
Expand All @@ -47,10 +47,10 @@ export function focusTrap(node: HTMLElement, enabled: boolean) {
return {
update(newArgs: boolean) {
enabled = newArgs;
newArgs ? onInit() : onDestory();
newArgs ? onInit() : onDestroy();
},
destroy() {
onDestory();
onDestroy();
}
};
}

0 comments on commit 52a0a12

Please sign in to comment.