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

fix: toggling a checkbox inside of an accordion item causes accordion item to collapse #6144

Closed
claviska opened this issue Jun 22, 2022 · 1 comment · Fixed by #6158
Closed
Assignees
Labels
area:fast-foundation Pertains to fast-foundation bug A bug status:in-progress Work is in progress

Comments

@claviska
Copy link
Contributor

🐛 Bug Report

💻 Repro or Code Sample

https://jsfiddle.net/teu5bnof/

🤔 Expected Behavior

Toggling the checkbox shouldn't cause the accordion item to close.

🙃 Current Behavior

Toggling a checkbox causes the accordion item to close.

💁 Possible Solution

I haven't looked at the code, but it appears as if the change event emitted by the checkboxes may be related. A workaround is to call event.stopPropagation() on the change event emitted by the checkbox, as demonstrated here:

https://jsfiddle.net/teu5bnof/2/

@claviska claviska added the status:triage New Issue - needs triage label Jun 22, 2022
@scomea scomea self-assigned this Jun 23, 2022
@scomea
Copy link
Collaborator

scomea commented Jun 23, 2022

I believe the fix is for accordion to make sure that the event originated on a child accordion item:
private activeItemChange = (event: Event): void => { if (event.target === null || this.accordionItems.indexOf(event.target as HTMLElement) === -1){ return; }

fix coming soon

@EisenbergEffect EisenbergEffect added bug A bug status:in-progress Work is in progress area:fast-foundation Pertains to fast-foundation and removed status:triage New Issue - needs triage labels Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-foundation Pertains to fast-foundation bug A bug status:in-progress Work is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants