fix: 🐛 Prevent modifying tabindexes inside cookie modal

This commit is contained in:
Jérémy Munsch 2024-05-27 16:58:15 +02:00
parent c04eeb1124
commit 39d100e490
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -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");