Skip to content

Commit b52c93f

Browse files
committed
fix: use el.localName for case-insensitive textarea check in deopt paths
The deopt client paths compared the raw descriptor type (d.type / value.type) to the lowercase literal 'textarea', while the server normalizes via tag.toLowerCase(). createElement('TEXTAREA') therefore took the wrong client path (childSlot / reconcileDeoptChildren instead of the textarea text fold), causing a hydration mismatch. Use el.localName (which the DOM always lowercases) instead, matching the pattern already used in the spread path and throughout the runtime.
1 parent 24a56e5 commit b52c93f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32083,7 +32083,7 @@ function reconcileDeoptNode(
3208332083
if (!hasHostPropContent(value)) {
3208432084
reconcileDeoptChildren(
3208532085
el,
32086-
value.type === 'textarea' && elNs === undefined
32086+
el.localName === 'textarea' && elNs === undefined
3208732087
? textareaChildText(value.children, rejectTextareaChild)
3208832088
: value.children,
3208932089
ownerBlock,
@@ -32664,7 +32664,7 @@ function deoptHostChildren(
3266432664
elNs: string | undefined,
3266532665
adopt = false,
3266632666
): void {
32667-
if (d.type !== 'textarea' || elNs !== undefined) {
32667+
if (el.localName !== 'textarea' || elNs !== undefined) {
3266832668
childSlot(block, 0, el, d.children, null, false, el);
3266932669
return;
3267032670
}

0 commit comments

Comments
 (0)