From 39d100e490e364a8d7f35498ac05cdc9f32cb848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 27 May 2024 16:58:15 +0200 Subject: [PATCH] fix: :bug: Prevent modifying tabindexes inside cookie modal --- src/ts/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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");