-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Unable to close open AccordionItem when autocollapse is used #945
Comments
Sorry if this was missed in prior discussion, but this is working as intended. Remove
We'll keep this ticket open to address this. |
@endigo9740 I understand that you're already swamped with the 1.0 release. Would you be willing to accept a PR for this feature? |
It's not an issue if it's working as intended. So no, I would not not. |
Should this be submitted as a feature request? 😅 The usecase is very common - allow user to collapse all items if needed, while also limiting the number of collapsed items to be at max 1 Plus the initial state of the accordion is all-closed, so why not? 🤷 |
Although the workaround is pretty simple <script>
import { Accordion, AccordionItem } from '@skeletonlabs/skeleton'
let open = null
</script>
<Accordion>
{#each [1, 2, 3] as index (index)}
<AccordionItem on:click={() => {open = open === index ? null : index}} open={open === index}>
<svelte:fragment slot="summary">{index}</svelte:fragment>
<svelte:fragment slot="content">{index}</svelte:fragment>
</AccordionItem>
{/each}
</Accordion> |
Can we have this feature request open, @endigo9740 @AgarwalPragy ? One of the feedback I received during my user test is why the heck they can't close the accordion haha. But at the same time, I wanna keep the auto collapse function. |
For starters, you can use the workaround mentioned above #945 (comment) |
Current Behavior
Upgraded a project to v0.124.2 and migrated the accordion I have.
As the title really, when autocollapse is set on the Accordion, the open item cannot be closed.
Also on:toggle doesn't seem to fire. Let me know if you want that in a separate issue or keep it with this as it's related.
Steps To Reproduce
Add this into a page and the open item should close when clicked
The text was updated successfully, but these errors were encountered: