Commit fbf7069
committed
Fix controlled radios, maybe for real this time (#27443)
Fixes #26876 for real?
In 18.2.0 (last stable), we set .checked unconditionally:
https://github.com/facebook/react/blob/v18.2.0/packages/react-dom/src/client/ReactDOMInput.js#L129-L135
This is important because if we are updating two radios' checkedness
from (false, true) to (true, false), we need to make sure that
input2.checked is explicitly set to false, even though setting
`input1.checked = true` already unchecks input2.
I think this fix is not complete because there is no guarantee that all
the inputs rerender at the same time? Hence the TODO. But in practice
they usually would and I _think_ this is comparable to what we had
before.
Also treating function and symbol as false like we used to and like we
do on initial mount.
DiffTrain build for [4f4c52a](4f4c52a)1 parent 9d56820 commit fbf7069
14 files changed
Lines changed: 66 additions & 46 deletions
File tree
- compiled/facebook-www
| 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 | |
|---|---|---|---|
| |||
3899 | 3899 | | |
3900 | 3900 | | |
3901 | 3901 | | |
3902 | | - | |
3903 | | - | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
3904 | 3909 | | |
3905 | 3910 | | |
3906 | 3911 | | |
| |||
33972 | 33977 | | |
33973 | 33978 | | |
33974 | 33979 | | |
33975 | | - | |
| 33980 | + | |
33976 | 33981 | | |
33977 | 33982 | | |
33978 | 33983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3741 | 3741 | | |
3742 | 3742 | | |
3743 | 3743 | | |
3744 | | - | |
3745 | | - | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
3746 | 3751 | | |
3747 | 3752 | | |
3748 | 3753 | | |
| |||
33817 | 33822 | | |
33818 | 33823 | | |
33819 | 33824 | | |
33820 | | - | |
| 33825 | + | |
33821 | 33826 | | |
33822 | 33827 | | |
33823 | 33828 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | | - | |
1042 | | - | |
| 1041 | + | |
| 1042 | + | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
| |||
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 | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
896 | | - | |
| 895 | + | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| |||
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 | |
|---|---|---|---|
| |||
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | | - | |
1186 | | - | |
| 1185 | + | |
| 1186 | + | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
| |||
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 | |
|---|---|---|---|
| |||
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
1039 | | - | |
1040 | | - | |
| 1039 | + | |
| 1040 | + | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
| |||
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