You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accordions that exists but have not buttons currently crash the JS on the line: buttons[0].setAttribute("aria-expanded", "true")
We should check if at least one button is available before trying to set it to expanded.
Im also not sure about the check for the aria-expanded value by just using getAttribute, as that also returns True for 'false' strings when used like this: if(elem.getAttribute('aria-expanded')) on <elem aria-explanded="false"></elem> which is not what the code expects to do on line 48 of accordion.js
ppvg
changed the title
harder accordion Javascript against accordions that have no buttons
Harden accordion Javascript against accordions that have no buttons
May 8, 2024
Describe the bug, issue or concern
Accordions that exists but have not buttons currently crash the JS on the line:
buttons[0].setAttribute("aria-expanded", "true")
We should check if at least one button is available before trying to set it to expanded.
Im also not sure about the check for the aria-expanded value by just using getAttribute, as that also returns True for 'false' strings when used like this:
if(elem.getAttribute('aria-expanded'))
on<elem aria-explanded="false"></elem>
which is not what the code expects to do on line 48 of accordion.jsTo Reproduce
Steps to reproduce the behavior:
Expected behavior
Init all accordions as properly as possible
Governance
The text was updated successfully, but these errors were encountered: