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
Submitting a conform driven <Form /> by "press Enter on input" should not make a real POST submission to server. It should behave the same as clicking a submit button.
Quick comparison:
Submit by click submit button
Submit by press Enter
<Form />
Acts the same as others bandicam.2024-02-23.17-38-15-684.mp4
Acts the same as others bandicam.2024-02-23.17-39-02-273.mp4
<Form /> with conform
Acts the same as others bandicam.2024-02-23.17-50-41-381.mp4
Bug: It acts the same as others AND make a real POST submission to server bandicam.2024-02-23.17-51-57-065.mp4
I've tried hard to make a very minimum reproduction to reveal root cause. I believe the bug is occurring with all of these conditions are met:
Discussed in #476
Originally posted by QzCurious February 21, 2024
Describe the bug and the expected behavior
Submitting a conform driven
<Form />
by "press Enter on input" should not make a real POST submission to server. It should behave the same as clicking a submit button.Quick comparison:
<Form />
bandicam.2024-02-23.17-38-15-684.mp4
bandicam.2024-02-23.17-39-02-273.mp4
<Form />
with conformbandicam.2024-02-23.17-50-41-381.mp4
bandicam.2024-02-23.17-51-57-065.mp4
I've tried hard to make a very minimum reproduction to reveal root cause. I believe the bug is occurring with all of these conditions are met:
clientAction
reply with{ resetForm: true }
useForm
withlastResult
(of cause) ANDshouldValidate
being"onBlur"
Apply one of the following changes workaround the bug:
<Form />
by submit button works finesubmission.reply()
, that is, without{ resetForm: true }
action
instead ofclientAction
(But I want a SPA app)shouldValidate
beingonInput
oronSubmit
Conform version
v1.0.2
Steps to Reproduce the Bug or Issue
git clone https://github.com/QzCurious/conform-remix-vite-form-submission-bug
pnpm i
pnpm dev
and open the web page<Form />
with conform" and press Enter<Form />
is handled byclientAction
, AND it make a real POST submission to server.What browsers are you seeing the problem on?
No response
Screenshots or Videos
Screen.Recording.2024-02-22.at.12.16.31.AM.mov
Additional context
Remix with Vite were just marked stable today.
The text was updated successfully, but these errors were encountered: