-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Possible solution for Accordion #59
Comments
Thanks, @Neophen. Are you able to send a PR for review and merge? |
Not much time but will try! |
Awesome!!! @Neophen, I'm looking for a way to implement accordion without js but still not find any. |
merged #61 |
Thanks so much for this! I'm a little surprised I had to manually add the JS since it looks like it was merged a few months ago: const liveSocket = new LiveSocket('/live', Socket, {
...
dom: {
onBeforeElUpdated: (fromEl: HTMLElement, toEl: HTMLElement) => {
if (fromEl.hasAttribute('open')) {
toEl.setAttribute('open', '')
}
return true
}
}
}) I'm on version 0.14. Did I miss an install step or something? |
Hi @enoonan, what is your usecase with accordion? When adding accordion, I though it would be rendered once and not update from liveview so I omitted the js code. |
It's an interface that displays some interactive widgety things with buttons that push to liveview. I was having the same issue of my accordions closing when the user would click "approve". The JS snippet @/Neophen posted is very handy - I just misunderstood the comments here and thought it had been merged into the main library, so I was surprised I was even still encountering the issue. |
Hey i've done this one ages ago, i've cleaned it up to look like shadcn/ui so you can basically copy paste things from here i can make the elements for ex:
https://play.tailwindcss.com/zk94DHTrbl
No javascript but most likely needs the bellow code to prevent closing on live_view updates
here's the components:
The text was updated successfully, but these errors were encountered: