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

form inputs instantly close Collapsible. #231

Open
zaweb opened this issue Aug 1, 2022 · 4 comments
Open

form inputs instantly close Collapsible. #231

zaweb opened this issue Aug 1, 2022 · 4 comments

Comments

@zaweb
Copy link

zaweb commented Aug 1, 2022

I have a form that appears when the Collapsible is opened. The Collapse is instantly closed whenever any key is pressed in any field. This makes filling out a collapsible form impossible.
My field inputs use a simple onChange handler, so it's unclear why any keystroke triggers the Collapsible to close.
Is this expected behavior?
Thank you!

@karltaylor
Copy link
Collaborator

Hey @zaweb, please can you provide a MRE

@zaweb
Copy link
Author

zaweb commented Aug 1, 2022

Hmm... Unfortunately, I can't reproduce it on jsfiddle. Figures. I wonder if it's something to do with reactstrap...
I'll see if I can work around it on my own since I can't give you much to work with.
Thank you.

@zaweb
Copy link
Author

zaweb commented Aug 1, 2022

If it helps, here's where I'm having the problem:

<CInput
name={`foos[${index}].${key}`}
value={foo[key]}
 onChange={(e) => {handleUpdateProperty(`foos[${index}].${key}`, e.target.value, 'foos') }}
/>

If I remove "value={foo[key]}" then it works fine. But if it's in there, it instantly closes on any keystroke in an input field.

@j-eick
Copy link

j-eick commented Sep 4, 2022

I have a form that appears when the Collapsible is opened. The Collapse is instantly closed whenever any key is pressed in any field. This makes filling out a collapsible form impossible. My field inputs use a simple onChange handler, so it's unclear why any keystroke triggers the Collapsible to close. Is this expected behavior? Thank you!

Thank you so much for your post. I wanted to use this package for a formular as well.

Question:
My form has 5 input fields with one submit button at the end. Would a click into the second input field (after filling out the first one) close the collapsible?
If I understood your post correctly, then this is the case. Can you confirm?

Thanks in advance!

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

No branches or pull requests

3 participants