diff --git a/src/ts/index.ts b/src/ts/index.ts index f43fd5f..9a1ec23 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -648,7 +648,8 @@ export default class CookieNotice { .filter( (el) => !el.hasAttribute("disabled") && - !el.getAttribute("aria-hidden") + !el.getAttribute("aria-hidden") && + !this.cookieContainer.contains(el) ) .forEach((el) => { (el as HTMLElement).setAttribute("tabindex", "-1"); @@ -664,7 +665,8 @@ export default class CookieNotice { (el as HTMLElement).offsetWidth || (el as HTMLElement).offsetHeight || el.getClientRects().length - ) + ) && + !this.cookieContainer.contains(el) ) .forEach((el) => { (el as HTMLElement).setAttribute("tabindex", "0");