fomantic / Fomantic-UI

Fomantic-UI is the official community fork of Semantic-UI
https://fomantic-ui.com
MIT License
3.57k stars 331 forks source link

[accordion] `exclusive` accordions should call their callbacks for both the opening and the closing element #2826

Open ddabble opened 1 year ago

ddabble commented 1 year ago

Feature Request

For accordions with the exclusive setting set to true, when one element is already open and the user opens another element (so that the first one automatically closes), the callbacks in the settings section of the docs are only called for the element that is opened, and not the one that is closed (as of FUI v2.9.2).

It would be useful to have the callbacks called for both affected elements, so that the developer does not have to iterate over the other elements to find which one was affected, in case they want to do something with it. (In my case - which motivated opening this issue - it's to set the aria-expanded attribute to true/false, as well as setting the inert attribute on closing accordion .content to prevent keyboard focus while the closing animation is playing.)

Example (if possible)

If the explanation above is not entirely clear, do post a comment, and I can create an example 🙂

Screenshot (if possible)

lubber-de commented 1 year ago

Fixed by #2879