-
Notifications
You must be signed in to change notification settings - Fork 766
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
Accordion issue with Flowbite 2.2 #758
Comments
I made a minimal demo in CodePen here: Frontend-only view: As expected, despite the sequential numbering throughout the page, only the last FAQ section is working with Flowbite 2.2. |
Hey @BrynCB, Thanks for opening up the issue. I'll have a look at this after the holidays for the Cheers, |
@zoltanszogyenyi Is there any update on this bug? |
I'm experiencing the same issue here. |
same issue |
version:
Screen.Recording.2024-10-06.184151.mp4 |
Any update on this issue? Exactly the same problem - only the last item in the accordion can be toggled open/closed. |
Describe the bug
Flowbite 2.2 is unable to work flexibly with accordions in the same way that 1.8.1 (and possibly other versions) could. In my custom blocks for Gutenberg, each accordion (H2 + content div) is wrapped in a div due to the nature of repeatable InnerBlocks in the WordPress post editor. The accordions are used for an FAQ.
The data attributes are still sequentially numbered, but FAQ items can be interspersed on a page across multiple block instances (for example, when multiple FAQ sections are used, each with its own heading). That's not to say data attributes reset the count each time - they are sequential down a given page no matter how many separate blocks are present. This was not a problem with 1.8.1 - which I've reverted to for the time being - and is a problem with 2.2. When using 2.2 (the latest as of writing this), only the FAQ items in the last block containing accordion code are functional. The other accordion items on any given page are unresponsive.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
All accordion items expand on click. If only one should be expanded at one time, they should collapse appropriately even when an item in another section/block is selected. This is how it works for me with 1.8.1.
Devices:
Behaviour is consistent for me across different browsers and devices.
Additional context
I am not using Flowbite in a React or Vue project. This is a WordPress plugin with PHP, JS, HTML & CSS. I haven't experienced other issues with Flowbite's JS features, and 1.8.1 works flawlessly for me.
The text was updated successfully, but these errors were encountered: