From 2316fc5f682bf372db14da242309c0b84b544abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Birkemeyer?= Date: Thu, 12 Feb 2026 14:57:14 +0000 Subject: [PATCH 1/3] Remove unnecessary param --- src/accordion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accordion.js b/src/accordion.js index 021da56..e1501b5 100644 --- a/src/accordion.js +++ b/src/accordion.js @@ -107,7 +107,7 @@ class wfaccordion { }); // Update ARIA states on click/tap - this.trigger.addEventListener('click', (event) => { + this.trigger.addEventListener('click', () => { this.toggle(); if (!this.settings.disableHashUpdate) { From 540983fd262bb6c9b0fb880bcd5b46162f400a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Birkemeyer?= Date: Thu, 12 Feb 2026 14:57:44 +0000 Subject: [PATCH 2/3] Add listener that expands the accordion if it is being targeted by an in-page anchor link --- src/accordion.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/accordion.js b/src/accordion.js index e1501b5..185a24a 100644 --- a/src/accordion.js +++ b/src/accordion.js @@ -114,6 +114,13 @@ class wfaccordion { this.updateHash(); } }); + + // Expand if being targeted by an in-page anchor link + this.trigger.addEventListener('focus', () => { + if (this.triggerId === getUrlHash()) { + this.expand(); + } + }) } } } From 9f12be35935c35a171ba1e9a11e66d6d8b9ce5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Birkemeyer?= Date: Thu, 12 Feb 2026 15:01:44 +0000 Subject: [PATCH 3/3] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8148c08..cf91377 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webfactory-accordion", - "version": "5.0.1", + "version": "5.1.0", "description": "A tiny script that progressively enhances static HTML with accessible and keyboard-enabled accordion functionality.", "main": "src/main.js", "repository": {