Skip to content
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

fix: removes redundent isOpen check in collapsable menu that is preventing users from customizing behaviour #2838

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FredrikMWold
Copy link

Description

The current implementation has both:
hidden={!isOpen}
{isOpen && children}

Not being able to control how collapsable content is shown, can cause issues when combining it with forms.
If you have form fields inside a collapsable element, the fields can end up not being mounted to the dom when the form is submitted, causing the fields not to be included in form data.

I dont think this is a very common use case so I dont think this needs a custom solution, but allowing the user to control the behaviour by targeting the data-state attribute, would be a good middleground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant