GSA / openacr

OpenACR is a digital native Accessibility Conformance Report (ACR). The initial development is based on Section 508 requirements. The main goal is to be able to compare the accessibility claims of digital products and services. A structured, self-validated, machine-readable documentation will provide for this.
https://gsa.github.io/openacr/
Other
90 stars 18 forks source link

Collapse All/Expand All 'stick' when accordions are manually opened/closed #296

Closed qjac closed 2 years ago

qjac commented 2 years ago

Collapse all seems to stick sometimes when a detail is manually opened.

Tested in chrome and firefox. If I manually expand sections, the 'collapse all' continues to have a strikethru and does not close the open drawers when pressed.

The reverse is also an issue. If I press expand all, but then close some manually, 'expand all' stays disabled.

Screenshot of the disabled 'close all' button and an open details pane. And the reverse.

Screen Shot 2022-01-27 at 3 58 39 PM Screen Shot 2022-01-27 at 4 03 45 PM
dmundra commented 2 years ago

The solution for this was to replace the addEventListener to use the 'toggle' event type instead of the click behavior to update the status of the buttons. Here is the link about the 'toggle' event type https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement/toggle_event