action formData not working as expected with modals.
See original GitHub issueWhat version of Remix are you using?
1.4.1
Steps to Reproduce
Build a multi-form route but with each form rendered in a modal pop-up. Reproduction: https://stackblitz.com/edit/github-fn9naa?file=app%2Froutes%2Finvitations.tsx
The work around is to pass an hidden input
that holds the value and name of the button
.
Workaround: https://stackblitz.com/edit/github-fn9naa-shsnbv?file=app%2Froutes%2Finvitations.tsx
Expected Behavior
When building a form within a modal. I would expect formData to have the same shape as it would without the modal.
formData: { email: 'asdf@asdf.com', _action: 'send' }
Actual Behavior
The formData loses the value for the button.
formData: { email: 'asdf@asdf.com' }
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Form action event not working on popup - Stack Overflow
SImply remove it from the modal click event listener. Everything will work as expected. No additional code or triggering required. Working: ...
Read more >FormData.append() - Web APIs | MDN
The append() method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key...
Read more >Form data loss prevention in React | by Evan Williams - Medium
One of the core problems we want to solve for our users is ensuring a proper balance between expected behavior and data loss...
Read more >Form redirects not working as expected - Hotwire Discussion
Hey all, I've been integrating turbo-rails into my Rails application and things have been moving along just fine. I'm running into an issue ......
Read more >Modals - Lightning Design System
(This scrolling is currently not available in Salesforce1 Mobile.) ... or “Close” button in the modal, or performs another action that closes the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🤖 Hello there,
We just published version
v1.5.0
which involves this issue. If you’d like to take it for a test run please try it out and let us know what you think!Thanks!
@rodrigofuentes, my apologies, it works in safari, but not Firefox or Chrome 😅
it does work however in all 3 if you use
reloadDocument
, which submits it using a document request instead of client side with javascript, so it’s something to do with our client side mutations, I’ve filed an internal ticket for this.on a second pass, it seems that chrome nor firefox acknowledge the button name/value at all (i gave the form the id)
this seems like a browser bug (not sure which side is “correct” though)