From 030158a3eb60ccbedd63122400fee80eb8db9fb4 Mon Sep 17 00:00:00 2001 From: Marie Birner Date: Mon, 10 Apr 2023 15:04:13 +0200 Subject: [PATCH] [BUGFIX] resolve firefox issue aria-pressed state --- frontend/main.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/main.ts b/frontend/main.ts index 678ce29..a6a8f5f 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -13,6 +13,7 @@ function initToggle() { if(toggle) { toggle.addEventListener('click', () => { toggle.ariaPressed = (toggle.ariaPressed === 'true') ? 'false' : 'true'; + toggle.setAttribute('aria-pressed', toggle.ariaPressed); const daysNoTrips = document.querySelectorAll('div[data-trips="0"]'); Array.prototype.forEach.call(daysNoTrips, (day: HTMLElement) => { @@ -26,6 +27,7 @@ function initToggle() { if(coxToggle) { coxToggle.addEventListener('click', () => { coxToggle.ariaPressed = (coxToggle.ariaPressed === 'true') ? 'false' : 'true'; + coxToggle.setAttribute('aria-pressed', coxToggle.ariaPressed); const noCoxNeeded = document.querySelectorAll('div[data-coxneeded="false"]'); Array.prototype.forEach.call(noCoxNeeded, (notNeeded: HTMLElement) => { @@ -40,6 +42,7 @@ function initToggle() { if(monthToggle) { monthToggle.addEventListener('click', () => { monthToggle.ariaPressed = (monthToggle.ariaPressed === 'true') ? 'false' : 'true'; + monthToggle.setAttribute('aria-pressed', monthToggle.ariaPressed); const currentMonth = monthToggle.dataset.month; if(currentMonth) {