You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The accordion uses a <button> element for the heading of the accordion item.
That becomes a problem if I want to add a button into the accordion header.
My use case is that I'm displaying a list of items. To save space, I use the accordion to display the name and some actions in the header. If the user wants more details, they can expand the accordion item to see/modify the contents.
I would like it add a delete button into the header to allow the user to remove an item from the list. However, as soon as I add a button, it breaks the HTML as it is invalid to have a <button> element inside a <button> element.
Note: I'm not sure if using a table would be more suitable for this, but flux table doesn't have collapsible rows.
// Before adding button
// After adding button
Code snippets
// flux code
<flux:accordion.heading>
<divclass="flex justify-between items-center">
<div>{{$item['import_data']['name'] ?? '(no name)'}}</div>
<div>
<flux:switchwire:model="form.items.{{$loop->index}}.is_approved"label="Is Approved"type="switch"
/>
<!-- any button breaks the html <button></button>-->
</div>
</div>
</flux:accordion.heading>
I expect to be able to add any component/element into the accordion heading, or to have collapsible rows in tables.
I figured the accordion would be an easier fix than adding extra functionality to tables.
Please confirm (incomplete submissions will not be addressed)
I have provided easy and step-by-step instructions to reproduce the bug.
I have provided code samples as text and NOT images.
I understand my bug report will be closed if I haven't met the criteria above.
The text was updated successfully, but these errors were encountered:
Note: I was able to get around the button limitation for now by using the flux icon directly, but it still feels like this should be changed to not use a button as the header item
Flux (pro) version
v1.1.2
Livewire version
v3.5.18
What is the problem?
The accordion uses a
<button>
element for the heading of the accordion item.That becomes a problem if I want to add a button into the accordion header.
My use case is that I'm displaying a list of items. To save space, I use the accordion to display the
name
and someactions
in the header. If the user wants more details, they can expand the accordion item to see/modify the contents.I would like it add a
delete
button into the header to allow the user to remove an item from the list. However, as soon as I add a button, it breaks the HTML as it is invalid to have a<button>
element inside a<button>
element.Note: I'm not sure if using a table would be more suitable for this, but flux table doesn't have collapsible rows.
// Before adding button
// After adding button
Code snippets
// flux code
// rendered code (without button)
How do you expect it to work?
I expect to be able to add any component/element into the accordion heading, or to have collapsible rows in tables.
I figured the accordion would be an easier fix than adding extra functionality to tables.
Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: