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

When form.insert is called with a object as the default value it will submit the form after the second time it is called #800

Open
daniel-a-marshall opened this issue Oct 10, 2024 · 2 comments

Comments

@daniel-a-marshall
Copy link

Describe the bug and the expected behavior

An issue happens when inserting fields into a field list. This specifically happens when supplying a default value to the form.insert function. More specifically it seems to have a problem when the default value is an object. I can make it work if the default value is a string or number. When you call the form.insert with an object as the default value the first time it works fine. The second time it will submit the form. I have created a minimal reproduction here on stackblitz. I'm sure I could be doing something wrong but I just don't know what it could be.

Conform version

v1.2.1

Steps to Reproduce the Bug or Issue

1 - Click add once and a new hacker.
1 - Click add again and the form submission will be sent.

What browsers are you seeing the problem on?

Chrome

Screenshots or Videos

No response

Additional context

No response

@Pouet--
Copy link

Pouet-- commented Oct 10, 2024

I am using version 1.1.5 and it works, so it is a bug(?) introduced by a newer version.
It seems to work correctly if you upgrade to v1.2.2.

@daniel-a-marshall
Copy link
Author

@Pouet-- That does work and I should have checked that. The reason I went back to 1.2.1 from 1.2.2 is that I'm still getting the react warning about spreading the key. I can try to work around that for now.

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

2 participants