Fix hydration when we have defaultValue or value on a textarea#5081
Merged
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
|
Size Change: +158 B (+0.2%) Total Size: 79.2 kB 📦 View Changed
ℹ️ View Unchanged
|
JoviDeCroock
commented
May 1, 2026
| // If excessDomChildren was not null, repopulate it with the current element's children: | ||
| excessDomChildren = excessDomChildren && slice.call(dom.childNodes); | ||
| excessDomChildren = | ||
| nodeType == 'textarea' && newProps.defaultValue != NULL |
Member
Author
There was a problem hiding this comment.
Basically makes us ignore children of a textarea so that we don't remove them in HTML the children of a textarea are its defaultValue, I know confusing right?
In HTML, the initial content of a <textarea> is specified between its opening and closing tags, not as a value attribute.
Member
There was a problem hiding this comment.
TIL too, I swore value was valid
JoviDeCroock
commented
May 1, 2026
|
|
||
| // As above, don't diff props during hydration | ||
| if (!isHydrating) { | ||
| if (!isHydrating || nodeType == 'textarea') { |
Member
Author
There was a problem hiding this comment.
This ensures that we go into value re-hydration for textareas
rschristian
approved these changes
May 1, 2026
4 tasks
JoviDeCroock
added a commit
that referenced
this pull request
May 16, 2026
* Fix incorrect DOM order with conditional ContextProvider and inner keys (#5065) (#5067) When a VNode is moved via INSERT_VNODE during diffChildren, its old _dom pointer becomes a stale positional reference. Nested diffs that call getDomSibling would traverse the old VNode tree and find this stale _dom, causing subsequent DOM insertions at the wrong position. Clear the old VNode's _dom after insert so getDomSibling skips moved VNodes and finds the correct insertion point. * Create a unique event-clock for each Preact instance on a page. (#5068) * Fix migrations when we have defaultValue or value on a textarea (#5081) * Add CODEOWNERS for GitHub configuration (#5088) * chore: remove unused Fragment import in forwardported test
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5080.
Summary
defaultValuevalueduring hydrationdefaultValueandvalue