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

Remix resetForm: true not working when submit from keyboard ("Enter" key) on Chrome #701

Open
davidesigner opened this issue Jul 7, 2024 · 3 comments

Comments

@davidesigner
Copy link

Describe the bug and the expected behavior

When I activate the resetForm and follow the tips from the Conform Remix documentation, I have an unexpected behaviour when I use the keyboard to submit the form.

Conform version

v1.1.5

Steps to Reproduce the Bug or Issue

No problem on Safari, only on Chrome...

  1. Open this sandbox: https://codesandbox.io/p/devbox/conform-reset-form-ffv2zs?file=%2Fapp%2Froutes%2Fsignup.tsx
  2. Complete the form.
  3. Click "Enter" from a field → you will see that the form is not reset.
    • Moreover, a second POST request is made on the page itself (not on the loader ?_data is missing), that is not normal.
  4. Click on the submit button → you will see that the form is reset as expected.
    • Only one POST request as expected.
  5. If you change the code to disable the resetForm: resetForm: false, and retry the same test.
    • The form is not reset, but you will see that in both cases (keyboard and click), there is only one POST request.

What browsers are you seeing the problem on?

Chrome

Screenshots or Videos

As you can see here:

Screen.Recording.July.7.mov

The form is not reset when I submit the form from the "Enter" key on my keyboard from a field. But when I click on the submit button, the form is reset as expected.

Additional context

I don't understand why when I use the keyboard to submit the form on Chrome, there is second POST requests?

@edmundhung
Copy link
Owner

Seems to me the same problem as #730 which should be resolved once we release #729.

@edmundhung
Copy link
Owner

Just tested the repo with v1.2.1 and the issue seems to be resolved. Thanks again!

@davidesigner
Copy link
Author

I confirm 💪 thanks 🙏

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