Bug: formMethod specified on the submit button doesn't override the method from useFormStatus.
React version: 19.1
When using formMethod on a submit button (<button type="submit" formMethod={"post"}> or <input type="submit" formMethod={"post"}>), it should override the parent form's method. However, it does not.
Steps To Reproduce
- Open example (link below)
- Click to any "Submit button"
- under the text input field will "method" will be shown.
Link to code example:
https://codesandbox.io/p/sandbox/react-dev-forked-ks99yw
The current behavior
Displayed method: dialog
The expected behavior
Displayed method: post
I’d like to take this on. Please let me know if there’s anything I should be aware of before I begin.
But it works if add formAction - maybe that's the catch?
@levkovich2806
You're absolutely right to bring this up — it’s a subtle but important distinction.
According to the HTML specification, the formmethod attribute on a submit button should override the form’s method, regardless of whether formaction is present.
"If specified, this attribute overrides the method attribute of the form element that owns this control."
So while adding formAction may appear to "fix" the issue in some browsers or setups, React should still respect formMethod even when formAction is omitted — to match the spec and native form behavior.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump