-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Submitting forms in parent layout routes tries posting to wrong action. #11024
Comments
As a temporary fix I have done this in export { action } from "#my-parent.$someParam.my-child" |
In Remix, you can only post to a single route. The URL If you are including |
I'm unable to reproduce this. Here's a working example of submitting a parent form from a button in a child index route: https://stackblitz.com/edit/remix-run-remix-wcmw5v If I've misunderstood the issue, please feel free to re-open with a reproduction! |
Hey @brophdawg11 - here is the reproduction repo + corresponding stackblitz. Screen.Recording.2023-11-14.at.11.48.42.mov |
What happens when you rename this file: parent.child._index.tsx to this? parent.child.tsx |
Thanks for the reproduction! I'll re-open and try to take a look at the repro repo soon |
Thanks @brophdawg11 - I also added a small gif to illustrate the issue |
Thanks for the reproduction! This looks like it's a bug in |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
I have a layout route on
my-parent.$someParam.tsx
which adds a form and a action to handle the form.
inside that route there are three children:
my-parent._index.tsx
my-parent.$someParam.my-child.tsx
my-parent.$someParam.my-child._index.tsx
Now, when I am submitting the form on
/my-parent/some-value/my-child
, everything works as expected.But if I am on
/my-parent/some-value/my-child?index
, and I try submit, I get the following error:Expected Behavior
Forms should always submit to the action in their route, not some other route
Actual Behavior
For some reason, if i am on the
?index
path of some child route, actions of parent layout routes also try to post on their respective index routesThe text was updated successfully, but these errors were encountered: