Closed peerreynders closed 6 months ago
FormData is captured without including name/value of the submit button:
name
value
Defect location: In the vicinity of https://github.com/solidjs/solid-router/blob/9755b8d478c3c7270885da12528818ef43c52485/src/data/events.ts#L114
Compare to previous implementation: https://github.com/solidjs/solid-start/blob/443955f7fe677f558f613d80bafd78b570c136f6/packages/start/data/Form.tsx#L283-L287
Supporting background: FormData doesn't include value of buttons
Clicking on the Log In button when client side JS is enabled produces on the server side:
Log In
(email, kody@example.com) (password, twixrox)
Clicking on the Log In button when client side JS is disabled produces on the server side:
(email, kody@example.com) (password, twixrox) (kind, login)
i.e. the JS enabled version is lacking the "kind", "login" name/value pair from the (clicked) button element inside the <form>.
"kind"
"login"
button
<form>
https://github.com/peerreynders/solid-router-formdata
See https://github.com/peerreynders/solid-router-formdata/blob/main/README.md
The FormData to be identical regardless whether client JS is enabled or disabled.
No response
Thanks never noticed that previously but then again we have to thank Remix for a lot of the research there.
Describe the bug
FormData is captured without including
name
/value
of the submit button:Defect location: In the vicinity of https://github.com/solidjs/solid-router/blob/9755b8d478c3c7270885da12528818ef43c52485/src/data/events.ts#L114
Compare to previous implementation: https://github.com/solidjs/solid-start/blob/443955f7fe677f558f613d80bafd78b570c136f6/packages/start/data/Form.tsx#L283-L287
Supporting background: FormData doesn't include value of buttons
Clicking on the
Log In
button when client side JS is enabled produces on the server side:Clicking on the
Log In
button when client side JS is disabled produces on the server side:i.e. the JS enabled version is lacking the
"kind"
,"login"
name
/value
pair from the (clicked)button
element inside the<form>
.Your Example Website or App
https://github.com/peerreynders/solid-router-formdata
Steps to Reproduce the Bug or Issue
See https://github.com/peerreynders/solid-router-formdata/blob/main/README.md
Expected behavior
The FormData to be identical regardless whether client JS is enabled or disabled.
Screenshots or Videos
No response
Platform
Additional context
No response