Skip to content
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

Restore server controlled form fields to whatever they should be #26708

Merged
merged 2 commits into from
Apr 23, 2023

Conversation

sebmarkbage
Copy link
Collaborator

Fizz can emit whatever it wants for the SSR version of these fields when it's a function action so they might not align with what is in the previous props. Therefore we need to force them to update if we're updating to a non-function where they might be relevant again.

@sebmarkbage sebmarkbage requested a review from sophiebits April 23, 2023 19:46
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 23, 2023
@react-sizebot
Copy link

react-sizebot commented Apr 23, 2023

Comparing: 36e4cbe...fbcdceb

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 163.95 kB 163.94 kB = 51.68 kB 51.68 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.19% 168.29 kB 168.61 kB +0.17% 52.94 kB 53.03 kB
facebook-www/ReactDOM-prod.classic.js +0.28% 568.30 kB 569.90 kB +0.19% 100.65 kB 100.85 kB
facebook-www/ReactDOM-prod.modern.js +0.29% 552.03 kB 553.63 kB +0.19% 97.99 kB 98.18 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactDOM-prod.modern.js +0.29% 552.03 kB 553.63 kB +0.19% 97.99 kB 98.18 kB
facebook-www/ReactDOM-prod.classic.js +0.28% 568.30 kB 569.90 kB +0.19% 100.65 kB 100.85 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.28% 568.57 kB 570.17 kB +0.19% 102.09 kB 102.28 kB
facebook-www/ReactDOM-profiling.modern.js +0.27% 582.45 kB 584.05 kB +0.18% 102.47 kB 102.66 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.27% 583.11 kB 584.71 kB +0.18% 104.37 kB 104.55 kB
facebook-www/ReactDOM-profiling.classic.js +0.27% 598.79 kB 600.38 kB +0.18% 105.15 kB 105.35 kB
facebook-www/ReactDOM-dev.modern.js +0.21% 1,408.00 kB 1,410.93 kB +0.17% 304.59 kB 305.11 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.20% 1,426.35 kB 1,429.27 kB +0.17% 308.98 kB 309.52 kB
facebook-www/ReactDOM-dev.classic.js +0.20% 1,435.90 kB 1,438.82 kB +0.17% 310.23 kB 310.76 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.20% 1,454.24 kB 1,457.17 kB +0.17% 314.66 kB 315.19 kB

Generated by 🚫 dangerJS against fbcdceb

@@ -131,7 +131,6 @@ export function updateInput(
// Submit/reset inputs need the attribute removed completely to avoid
// blank-text buttons.
node.removeAttribute('value');
return;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that this return was problematic because we don't restore the name after setting it to empty.

Fizz can emit whatever for the SSR version of these fields when it's a
function actual so they might not align with what is in the previous props.
Therefore we need to force them to update if we're updating to a non-function
where they might be relevant again.
@sebmarkbage sebmarkbage merged commit 2fa6323 into facebook:main Apr 23, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…ebook#26708)

Fizz can emit whatever it wants for the SSR version of these fields when
it's a function action so they might not align with what is in the
previous props. Therefore we need to force them to update if we're
updating to a non-function where they might be relevant again.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
)

Fizz can emit whatever it wants for the SSR version of these fields when
it's a function action so they might not align with what is in the
previous props. Therefore we need to force them to update if we're
updating to a non-function where they might be relevant again.

DiffTrain build for commit 2fa6323.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants