Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple toggle targets #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

julianrubisch
Copy link
Collaborator

This PR allows to toggle multiple targets in a way that adheres to the aria-controls specification 🎉

Specifically, I've expanded the targetElement to a list of elements defined by a list of IDs in aria-controls where applicable.

Here's a quick example repo: https://github.com/julianrubisch/turbo_boost-elements-test. Firing this up and adding a post, you should get this:

CleanShot.2023-07-17.at.14.02.02.mp4

There's a final TODO I haven't yet tackled: https://github.com/hopsoft/turbo_boost-elements/compare/main...julianrubisch:turbo_boost-elements:multiple-toggle-targets?expand=1#diff-cb87972fc68e152400f137350beab0650332a06e765d64044854eb6c6a4a0f78R105

Also, to stay consistent with the single-item case, I check whether any of the controlled DOM ids is expanded: https://github.com/hopsoft/turbo_boost-elements/compare/main...julianrubisch:turbo_boost-elements:multiple-toggle-targets?expand=1#diff-0d05fcbb54bf4cb3d6e33827837c58e3ef26562c08cb80740721a5110eb09257R85 - Should this be an .all? ? I should note that I've not yet thought about the "mixed" case, where some elements are expanded and others aren't.

We will have to tend to the devtools separately, they're currently only pointing at the first targetElement.

@julianrubisch julianrubisch requested a review from hopsoft July 17, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant