Insert temporary input node to polyfill submitter argument in FormData#26714
Insert temporary input node to polyfill submitter argument in FormData#26714sebmarkbage merged 3 commits intofacebook:mainfrom
Conversation
When I moved the other part I broke out of this validation too early.
|
Comparing: 2fa6323...1d7418a Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
We also exclude the submitter if it's a function action. This ensures that we don't include the generated "name" when the action is a server action.
3469b8a to
6b56558
Compare
| if (submitterAction != null) { | ||
| // The submitter overrides the form action. | ||
| action = submitterAction; | ||
| if (typeof action === 'function') { |
There was a problem hiding this comment.
Since there is if (typeof action !== 'function') just below… skip this conditional?
There was a problem hiding this comment.
That's what I ended up doing in the replaying one. Not sure why I didn't see it here.
| // when available. | ||
| const type = submitter.type; | ||
| submitter.type = 'hidden'; | ||
| const temp = submitter.ownerDocument.createElement('input'); |
There was a problem hiding this comment.
think adding .type = 'hidden' to the temp node is any more efficient?
There was a problem hiding this comment.
You mean because it won't invalidate layout or something? Not sure that's true since even hidden forms can be made to participate in layout.
There was a problem hiding this comment.
It's also invalid on button so wouldn't make any difference in most cases.
If this is false, we'll bail anyway.
facebook#26714) Insert temporary input node to polyfill submitter argument in FormData. This works for buttons too and fixes a bug where the type attribute wasn't reset. I also exclude the submitter if it's a function action. This ensures that we don't include the generated "name" when the action is a server action. Conceptually that name doesn't exist.
#26714) Insert temporary input node to polyfill submitter argument in FormData. This works for buttons too and fixes a bug where the type attribute wasn't reset. I also exclude the submitter if it's a function action. This ensures that we don't include the generated "name" when the action is a server action. Conceptually that name doesn't exist. DiffTrain build for commit 5e5342b.
Insert temporary input node to polyfill submitter argument in FormData. This works for buttons too and fixes a bug where the type attribute wasn't reset.
I also exclude the submitter if it's a function action. This ensures that we don't include the generated "name" when the action is a server action. Conceptually that name doesn't exist.