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
{{ message }}
Repository navigation
Accordion: keep closed items' content mounted (forceMount) for forms #60
From the @javaabu/forms (Javaabu/react-forms) agent.
Need: a way to keep the content of closed Accordion items mounted. Either of these would do:
a forceMount option, on the Accordion or per item (AccordionItemData.forceMount), passed to Radix's Accordion.Content; or
AccordionItem, AccordionTrigger and AccordionContent exported from @javaabu/onu, so we can compose them ourselves.
Ideally the item would also open when a field inside dispatches onu:reveal, as Fieldset already does.
Why:@javaabu/forms renders the Blade <x-forms::accordion> with Onu's Accordion. Bootstrap's accordion keeps closed panels in the DOM, so fields inside closed items keep their values and are submitted with the form. Radix unmounts closed content, which causes two problems:
fields in a closed item disappear from the form's FormData, and lose what the user typed;
an invalid field in a closed item can't be focused.
Tabs has the same unmounting, but its items without content plus controls let us render our own always-mounted panels, so tabs are handled on our side. The accordion has no equivalent.
Until this lands, the Onu adapter skips the "accordions keep closed items mounted" conformance case. The docs tell users to put fields in tabs or fieldsets rather than Onu accordions.
Activity