-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
bug fix on input radio #11227
bug fix on input radio #11227
Changes from 2 commits
4ce1fb0
0e15659
6f3a000
aad2f64
03b1b30
69cbb05
25c0fc4
e03b117
9ee15eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -814,23 +814,11 @@ var ReactDOMFiberComponent = { | |
lastRawProps: Object, | ||
nextRawProps: Object, | ||
): void { | ||
var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); | ||
var isCustomComponentTag = isCustomComponent(tag, nextRawProps); | ||
// Apply the diff. | ||
updateDOMProperties( | ||
domElement, | ||
updatePayload, | ||
wasCustomComponentTag, | ||
isCustomComponentTag, | ||
); | ||
|
||
// TODO: Ensure that an update gets scheduled if any of the special props | ||
// changed. | ||
switch (tag) { | ||
case 'input': | ||
// Update the wrapper around inputs *after* updating props. This has to | ||
// happen after `updateDOMProperties`. Otherwise HTML5 input validations | ||
// raise warnings and prevent the new value from being assigned. | ||
// Update the wrapper around inputs *after* updating props. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment isn't correct anymore since you've moved the @nhunzaker Any suggestions on how to write that, or what conditions triggered it? |
||
ReactDOMFiberInput.updateWrapper(domElement, nextRawProps); | ||
|
||
// We also check that we haven't missed a value update, such as a | ||
|
@@ -840,11 +828,21 @@ var ReactDOMFiberComponent = { | |
case 'textarea': | ||
ReactDOMFiberTextarea.updateWrapper(domElement, nextRawProps); | ||
break; | ||
case 'select': | ||
// <select> value update needs to occur after <option> children | ||
// reconciliation | ||
ReactDOMFiberSelect.postUpdateWrapper(domElement, nextRawProps); | ||
break; | ||
} | ||
var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); | ||
var isCustomComponentTag = isCustomComponent(tag, nextRawProps); | ||
// Apply the diff. | ||
updateDOMProperties( | ||
domElement, | ||
updatePayload, | ||
wasCustomComponentTag, | ||
isCustomComponentTag, | ||
); | ||
|
||
if (tag === 'select') { | ||
// <select> value update needs to occur after <option> children | ||
// reconciliation | ||
ReactDOMFiberSelect.postUpdateWrapper(domElement, nextRawProps); | ||
} | ||
}, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind rephrasing this to
should check the correct radio when the selected name moves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. yours is better