Commit 3d74031
committed
Fix checkbox and radio hydration (#27401)
Fixes whatever part of #26876
and vercel/next.js#49499 that
#27394 didn't fix, probably.
From manual tests I believe this behavior brings us back to parity with
latest stable release (18.2.0). It's awkward that we keep the user's
state even for controlled inputs, so the DOM is out of sync with React
state.
Previously the .defaultChecked assignment done in updateInput() was
changing the actual checkedness because the dirty flag wasn't getting
set, meaning that hydrating could change which radio button is checked,
even in the absence of user interaction! Now we go back to always
detaching again.
DiffTrain build for [db69f95](db69f95)1 parent fbf7069 commit 3d74031
File tree
14 files changed
+52
-56
lines changed- compiled/facebook-www
14 files changed
+52
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
| 618 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4016 | 4016 | | |
4017 | 4017 | | |
4018 | 4018 | | |
4019 | | - | |
4020 | | - | |
4021 | | - | |
4022 | | - | |
4023 | | - | |
| 4019 | + | |
4024 | 4020 | | |
4025 | | - | |
| 4021 | + | |
| 4022 | + | |
| 4023 | + | |
| 4024 | + | |
4026 | 4025 | | |
4027 | 4026 | | |
4028 | 4027 | | |
| |||
33977 | 33976 | | |
33978 | 33977 | | |
33979 | 33978 | | |
33980 | | - | |
| 33979 | + | |
33981 | 33980 | | |
33982 | 33981 | | |
33983 | 33982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3858 | 3858 | | |
3859 | 3859 | | |
3860 | 3860 | | |
3861 | | - | |
3862 | | - | |
3863 | | - | |
3864 | | - | |
3865 | | - | |
| 3861 | + | |
3866 | 3862 | | |
3867 | | - | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
3868 | 3867 | | |
3869 | 3868 | | |
3870 | 3869 | | |
| |||
33822 | 33821 | | |
33823 | 33822 | | |
33824 | 33823 | | |
33825 | | - | |
| 33824 | + | |
33826 | 33825 | | |
33827 | 33826 | | |
33828 | 33827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
| 1087 | + | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
| |||
16375 | 16375 | | |
16376 | 16376 | | |
16377 | 16377 | | |
16378 | | - | |
| 16378 | + | |
16379 | 16379 | | |
16380 | 16380 | | |
16381 | 16381 | | |
| |||
16405 | 16405 | | |
16406 | 16406 | | |
16407 | 16407 | | |
16408 | | - | |
| 16408 | + | |
16409 | 16409 | | |
16410 | 16410 | | |
16411 | 16411 | | |
| |||
16742 | 16742 | | |
16743 | 16743 | | |
16744 | 16744 | | |
16745 | | - | |
| 16745 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
| |||
15897 | 15897 | | |
15898 | 15898 | | |
15899 | 15899 | | |
15900 | | - | |
| 15900 | + | |
15901 | 15901 | | |
15902 | 15902 | | |
15903 | 15903 | | |
| |||
15928 | 15928 | | |
15929 | 15929 | | |
15930 | 15930 | | |
15931 | | - | |
| 15931 | + | |
15932 | 15932 | | |
15933 | 15933 | | |
15934 | 15934 | | |
| |||
16193 | 16193 | | |
16194 | 16194 | | |
16195 | 16195 | | |
16196 | | - | |
| 16196 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | | - | |
| 1231 | + | |
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
| |||
17150 | 17150 | | |
17151 | 17151 | | |
17152 | 17152 | | |
17153 | | - | |
| 17153 | + | |
17154 | 17154 | | |
17155 | 17155 | | |
17156 | 17156 | | |
| |||
17194 | 17194 | | |
17195 | 17195 | | |
17196 | 17196 | | |
17197 | | - | |
| 17197 | + | |
17198 | 17198 | | |
17199 | 17199 | | |
17200 | 17200 | | |
| |||
17518 | 17518 | | |
17519 | 17519 | | |
17520 | 17520 | | |
17521 | | - | |
| 17521 | + | |
17522 | 17522 | | |
17523 | 17523 | | |
17524 | 17524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | | - | |
| 1085 | + | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| |||
16666 | 16666 | | |
16667 | 16667 | | |
16668 | 16668 | | |
16669 | | - | |
| 16669 | + | |
16670 | 16670 | | |
16671 | 16671 | | |
16672 | 16672 | | |
| |||
16711 | 16711 | | |
16712 | 16712 | | |
16713 | 16713 | | |
16714 | | - | |
| 16714 | + | |
16715 | 16715 | | |
16716 | 16716 | | |
16717 | 16717 | | |
| |||
16963 | 16963 | | |
16964 | 16964 | | |
16965 | 16965 | | |
16966 | | - | |
| 16966 | + | |
16967 | 16967 | | |
16968 | 16968 | | |
16969 | 16969 | | |
| |||
0 commit comments