diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 06d36ec5ff493..02e9f9fa7cb53 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -2bfe4b246f58d1f8d357f984fba9a8aa1fa79c73 +b433c379d55d9684945217c7d375de1082a1abb8 diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index fdbdf769e3137..260311ad76379 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-modern-40ddfb33"; +var ReactVersion = "18.3.0-www-modern-edf301ed"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index a38dd83ade1fe..f84d28ca77ee1 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-09c9197a"; +var ReactVersion = "18.3.0-www-classic-145c42eb"; var LegacyRoot = 0; var ConcurrentRoot = 1; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 26b0f48b81161..f16507c2ce1aa 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -9637,7 +9637,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-modern-342727fc", + version: "18.3.0-www-modern-294eaa58", rendererPackageName: "react-art" }; var internals$jscomp$inline_1317 = { @@ -9668,7 +9668,7 @@ var internals$jscomp$inline_1317 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-342727fc" + reconcilerVersion: "18.3.0-www-modern-294eaa58" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1318 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index b7033ac47d8dd..589ed500eb384 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -3779,19 +3779,40 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { var node = element; + if (value != null) { + if (type === "number") { + if ( + // $FlowFixMe[incompatible-type] + (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value + ) { + node.value = toString(getToStringValue(value)); + } + } else if (node.value !== toString(getToStringValue(value))) { + node.value = toString(getToStringValue(value)); + } + } else if (type === "submit" || type === "reset") { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute("value"); + return; + } + if (disableInputAttributeSyncing) { // When not syncing the value attribute, React only assigns a new value // whenever the defaultValue React prop has changed. When not present, // React does nothing if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } else { @@ -3804,7 +3825,7 @@ function updateInput( setDefaultValue(node, type, getToStringValue(value)); } else if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } @@ -3829,26 +3850,6 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } - - if (value != null) { - if (type === "number") { - if ( - // $FlowFixMe[incompatible-type] - (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value - ) { - node.value = toString(getToStringValue(value)); - } - } else if (node.value !== toString(getToStringValue(value))) { - node.value = toString(getToStringValue(value)); - } - } else if (type === "submit" || type === "reset") { - // Submit/reset inputs need the attribute removed completely to avoid - // blank-text buttons. - node.removeAttribute("value"); - return; - } } function initInput( element, @@ -3974,6 +3975,7 @@ function restoreControlledInputState(element, props) { rootNode, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -4029,6 +4031,7 @@ function restoreControlledInputState(element, props) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -33736,7 +33739,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-ffb509af"; +var ReactVersion = "18.3.0-www-classic-4a39e57d"; function createPortal$1( children, @@ -39353,25 +39356,25 @@ function updateProperties(domElement, tag, lastProps, nextProps) { var type = null; var value = null; var defaultValue = null; + var lastDefaultValue = null; var checked = null; var defaultChecked = null; for (var propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - lastProp != null && - !nextProps.hasOwnProperty(propKey) - ) { + if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; + if (!nextProps.hasOwnProperty(propKey)) { + var checkedValue = nextProps.defaultChecked; + var inputElement = domElement; + inputElement.checked = + !!checkedValue && + typeof checkedValue !== "function" && + checkedValue !== "symbol"; + } + break; } @@ -39379,10 +39382,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { // This is handled by updateWrapper below. break; } + + case "defaultValue": { + lastDefaultValue = lastProp; + } // defaultChecked and defaultValue are ignored by setProp + // Fallthrough default: { - setProp(domElement, tag, propKey, null, nextProps, lastProp); + if (!nextProps.hasOwnProperty(propKey)) + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } } @@ -39551,6 +39560,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -39952,6 +39962,7 @@ function updatePropertiesWithDiff( var type = nextProps.type; var value = nextProps.value; var defaultValue = nextProps.defaultValue; + var lastDefaultValue = lastProps.defaultValue; var checked = nextProps.checked; var defaultChecked = nextProps.defaultChecked; @@ -40092,6 +40103,7 @@ function updatePropertiesWithDiff( domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 9d879e5c0fefc..583b3f3b1ec08 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -3613,19 +3613,40 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { var node = element; + if (value != null) { + if (type === "number") { + if ( + // $FlowFixMe[incompatible-type] + (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value + ) { + node.value = toString(getToStringValue(value)); + } + } else if (node.value !== toString(getToStringValue(value))) { + node.value = toString(getToStringValue(value)); + } + } else if (type === "submit" || type === "reset") { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute("value"); + return; + } + if (disableInputAttributeSyncing) { // When not syncing the value attribute, React only assigns a new value // whenever the defaultValue React prop has changed. When not present, // React does nothing if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } else { @@ -3638,7 +3659,7 @@ function updateInput( setDefaultValue(node, type, getToStringValue(value)); } else if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } @@ -3663,26 +3684,6 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } - - if (value != null) { - if (type === "number") { - if ( - // $FlowFixMe[incompatible-type] - (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value - ) { - node.value = toString(getToStringValue(value)); - } - } else if (node.value !== toString(getToStringValue(value))) { - node.value = toString(getToStringValue(value)); - } - } else if (type === "submit" || type === "reset") { - // Submit/reset inputs need the attribute removed completely to avoid - // blank-text buttons. - node.removeAttribute("value"); - return; - } } function initInput( element, @@ -3808,6 +3809,7 @@ function restoreControlledInputState(element, props) { rootNode, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -3863,6 +3865,7 @@ function restoreControlledInputState(element, props) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -33573,7 +33576,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-342727fc"; +var ReactVersion = "18.3.0-www-modern-294eaa58"; function createPortal$1( children, @@ -39853,25 +39856,25 @@ function updateProperties(domElement, tag, lastProps, nextProps) { var type = null; var value = null; var defaultValue = null; + var lastDefaultValue = null; var checked = null; var defaultChecked = null; for (var propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - lastProp != null && - !nextProps.hasOwnProperty(propKey) - ) { + if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; + if (!nextProps.hasOwnProperty(propKey)) { + var checkedValue = nextProps.defaultChecked; + var inputElement = domElement; + inputElement.checked = + !!checkedValue && + typeof checkedValue !== "function" && + checkedValue !== "symbol"; + } + break; } @@ -39879,10 +39882,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { // This is handled by updateWrapper below. break; } + + case "defaultValue": { + lastDefaultValue = lastProp; + } // defaultChecked and defaultValue are ignored by setProp + // Fallthrough default: { - setProp(domElement, tag, propKey, null, nextProps, lastProp); + if (!nextProps.hasOwnProperty(propKey)) + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } } @@ -40051,6 +40060,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -40452,6 +40462,7 @@ function updatePropertiesWithDiff( var type = nextProps.type; var value = nextProps.value; var defaultValue = nextProps.defaultValue; + var lastDefaultValue = lastProps.defaultValue; var checked = nextProps.checked; var defaultChecked = nextProps.defaultChecked; @@ -40592,6 +40603,7 @@ function updatePropertiesWithDiff( domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 08a79200fbf27..da71c79f0b47c 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -971,19 +971,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -994,15 +1006,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1340,6 +1343,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -1366,6 +1370,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -14242,27 +14247,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$213 in nextProps) { @@ -14332,6 +14338,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -14341,23 +14348,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$213 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -14369,8 +14384,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$213, propKey, value, defaultValue); return; @@ -14437,15 +14459,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { propKey$213 ); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$213 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$213 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$213 !== propKey && (null != propKey$213 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$213 && @@ -14456,7 +14478,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - checked, + lastDefaultValue, propKey$213, nextProps, propKey @@ -14484,15 +14506,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$213 && !nextProps.hasOwnProperty(propKey$236) && setProp(domElement, tag, propKey$236, null, nextProps, propKey$213); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$213 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$213 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$213 !== propKey && (null != propKey$213 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$213) @@ -14502,7 +14524,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - defaultChecked, + checked, propKey$213, nextProps, propKey @@ -14524,16 +14546,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$213 ); - for (lastProp in nextProps) - (propKey$213 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$213 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$213 === propKey || (null == propKey$213 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$213, nextProps, propKey @@ -14547,13 +14569,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$213 && !nextProps.hasOwnProperty(propKey$246) && setProp(domElement, tag, propKey$246, null, nextProps, propKey$213); - for (var propKey$248 in nextProps) - (propKey$213 = nextProps[propKey$248]), - (propKey = lastProps[propKey$248]), - !nextProps.hasOwnProperty(propKey$248) || + for (lastProp in nextProps) + (propKey$213 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$213 === propKey || (null == propKey$213 && null == propKey) || - setProp(domElement, tag, propKey$248, propKey$213, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$213, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -14575,8 +14597,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -14625,44 +14648,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -16392,7 +16423,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1856 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-865dfeb0", + version: "18.3.0-www-classic-f6cc5f2f", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2222 = { @@ -16422,7 +16453,7 @@ var internals$jscomp$inline_2222 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-865dfeb0" + reconcilerVersion: "18.3.0-www-classic-f6cc5f2f" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2223 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16662,4 +16693,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-865dfeb0"; +exports.version = "18.3.0-www-classic-f6cc5f2f"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 81aa762c0448a..5dcc73df562c0 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -820,19 +820,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -843,15 +855,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1180,6 +1183,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -1206,6 +1210,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -14473,27 +14478,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$217 in nextProps) { @@ -14563,6 +14569,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -14572,23 +14579,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$217 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -14600,8 +14615,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$217, propKey, value, defaultValue); return; @@ -14668,15 +14690,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { propKey$217 ); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$217 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$217 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$217 !== propKey && (null != propKey$217 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$217 && @@ -14687,7 +14709,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - checked, + lastDefaultValue, propKey$217, nextProps, propKey @@ -14715,15 +14737,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$217 && !nextProps.hasOwnProperty(propKey$240) && setProp(domElement, tag, propKey$240, null, nextProps, propKey$217); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$217 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$217 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$217 !== propKey && (null != propKey$217 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$217) @@ -14733,7 +14755,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - defaultChecked, + checked, propKey$217, nextProps, propKey @@ -14755,16 +14777,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$217 ); - for (lastProp in nextProps) - (propKey$217 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$217 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$217 === propKey || (null == propKey$217 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$217, nextProps, propKey @@ -14778,13 +14800,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$217 && !nextProps.hasOwnProperty(propKey$250) && setProp(domElement, tag, propKey$250, null, nextProps, propKey$217); - for (var propKey$252 in nextProps) - (propKey$217 = nextProps[propKey$252]), - (propKey = lastProps[propKey$252]), - !nextProps.hasOwnProperty(propKey$252) || + for (lastProp in nextProps) + (propKey$217 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$217 === propKey || (null == propKey$217 && null == propKey) || - setProp(domElement, tag, propKey$252, propKey$217, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$217, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -14806,8 +14828,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -14856,44 +14879,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -15919,7 +15950,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1815 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-1d8e3f88", + version: "18.3.0-www-modern-a246c2d9", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2186 = { @@ -15950,7 +15981,7 @@ var internals$jscomp$inline_2186 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-1d8e3f88" + reconcilerVersion: "18.3.0-www-modern-a246c2d9" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2187 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16118,4 +16149,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-1d8e3f88"; +exports.version = "18.3.0-www-modern-a246c2d9"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index ddf9da5cda8f5..1a92ab09ba020 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -1115,19 +1115,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -1138,15 +1150,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1484,6 +1487,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -1510,6 +1514,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -15016,27 +15021,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$234 in nextProps) { @@ -15106,6 +15112,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -15115,23 +15122,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$234 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -15143,8 +15158,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$234, propKey, value, defaultValue); return; @@ -15211,15 +15233,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { propKey$234 ); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$234 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$234 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$234 !== propKey && (null != propKey$234 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$234 && @@ -15230,7 +15252,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - checked, + lastDefaultValue, propKey$234, nextProps, propKey @@ -15258,15 +15280,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$234 && !nextProps.hasOwnProperty(propKey$257) && setProp(domElement, tag, propKey$257, null, nextProps, propKey$234); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$234 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$234 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$234 !== propKey && (null != propKey$234 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$234) @@ -15276,7 +15298,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - defaultChecked, + checked, propKey$234, nextProps, propKey @@ -15298,16 +15320,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$234 ); - for (lastProp in nextProps) - (propKey$234 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$234 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$234 === propKey || (null == propKey$234 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$234, nextProps, propKey @@ -15321,13 +15343,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$234 && !nextProps.hasOwnProperty(propKey$267) && setProp(domElement, tag, propKey$267, null, nextProps, propKey$234); - for (var propKey$269 in nextProps) - (propKey$234 = nextProps[propKey$269]), - (propKey = lastProps[propKey$269]), - !nextProps.hasOwnProperty(propKey$269) || + for (lastProp in nextProps) + (propKey$234 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$234 === propKey || (null == propKey$234 && null == propKey) || - setProp(domElement, tag, propKey$269, propKey$234, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$234, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15349,8 +15371,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -15399,44 +15422,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -17166,7 +17197,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1937 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-ceea03b0", + version: "18.3.0-www-classic-e8d232f6", rendererPackageName: "react-dom" }; (function (internals) { @@ -17210,7 +17241,7 @@ var devToolsConfig$jscomp$inline_1937 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-ceea03b0" + reconcilerVersion: "18.3.0-www-classic-e8d232f6" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17437,7 +17468,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-ceea03b0"; +exports.version = "18.3.0-www-classic-e8d232f6"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 99c9641ed4080..57bc818fac0fb 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -964,19 +964,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -987,15 +999,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1324,6 +1327,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -1350,6 +1354,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -15241,27 +15246,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$238 in nextProps) { @@ -15331,6 +15337,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -15340,23 +15347,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$238 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -15368,8 +15383,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$238, propKey, value, defaultValue); return; @@ -15436,15 +15458,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { propKey$238 ); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$238 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$238 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$238 !== propKey && (null != propKey$238 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$238 && @@ -15455,7 +15477,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - checked, + lastDefaultValue, propKey$238, nextProps, propKey @@ -15483,15 +15505,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$238 && !nextProps.hasOwnProperty(propKey$261) && setProp(domElement, tag, propKey$261, null, nextProps, propKey$238); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$238 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$238 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$238 !== propKey && (null != propKey$238 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$238) @@ -15501,7 +15523,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - defaultChecked, + checked, propKey$238, nextProps, propKey @@ -15523,16 +15545,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$238 ); - for (lastProp in nextProps) - (propKey$238 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$238 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$238 === propKey || (null == propKey$238 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$238, nextProps, propKey @@ -15546,13 +15568,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$238 && !nextProps.hasOwnProperty(propKey$271) && setProp(domElement, tag, propKey$271, null, nextProps, propKey$238); - for (var propKey$273 in nextProps) - (propKey$238 = nextProps[propKey$273]), - (propKey = lastProps[propKey$273]), - !nextProps.hasOwnProperty(propKey$273) || + for (lastProp in nextProps) + (propKey$238 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$238 === propKey || (null == propKey$238 && null == propKey) || - setProp(domElement, tag, propKey$273, propKey$238, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$238, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15574,8 +15596,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -15624,44 +15647,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -16687,7 +16718,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1896 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-0c712c4b", + version: "18.3.0-www-modern-7ce8ddda", rendererPackageName: "react-dom" }; (function (internals) { @@ -16732,7 +16763,7 @@ var devToolsConfig$jscomp$inline_1896 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-0c712c4b" + reconcilerVersion: "18.3.0-www-modern-7ce8ddda" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -16887,7 +16918,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-0c712c4b"; +exports.version = "18.3.0-www-modern-7ce8ddda"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 90c54dafcff12..7374a4bd11801 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -3813,19 +3813,40 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { var node = element; + if (value != null) { + if (type === "number") { + if ( + // $FlowFixMe[incompatible-type] + (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value + ) { + node.value = toString(getToStringValue(value)); + } + } else if (node.value !== toString(getToStringValue(value))) { + node.value = toString(getToStringValue(value)); + } + } else if (type === "submit" || type === "reset") { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute("value"); + return; + } + if (disableInputAttributeSyncing) { // When not syncing the value attribute, React only assigns a new value // whenever the defaultValue React prop has changed. When not present, // React does nothing if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } else { @@ -3838,7 +3859,7 @@ function updateInput( setDefaultValue(node, type, getToStringValue(value)); } else if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } @@ -3863,26 +3884,6 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } - - if (value != null) { - if (type === "number") { - if ( - // $FlowFixMe[incompatible-type] - (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value - ) { - node.value = toString(getToStringValue(value)); - } - } else if (node.value !== toString(getToStringValue(value))) { - node.value = toString(getToStringValue(value)); - } - } else if (type === "submit" || type === "reset") { - // Submit/reset inputs need the attribute removed completely to avoid - // blank-text buttons. - node.removeAttribute("value"); - return; - } } function initInput( element, @@ -4008,6 +4009,7 @@ function restoreControlledInputState(element, props) { rootNode, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -4063,6 +4065,7 @@ function restoreControlledInputState(element, props) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -8274,25 +8277,25 @@ function updateProperties(domElement, tag, lastProps, nextProps) { var type = null; var value = null; var defaultValue = null; + var lastDefaultValue = null; var checked = null; var defaultChecked = null; for (var propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - lastProp != null && - !nextProps.hasOwnProperty(propKey) - ) { + if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; + if (!nextProps.hasOwnProperty(propKey)) { + var checkedValue = nextProps.defaultChecked; + var inputElement = domElement; + inputElement.checked = + !!checkedValue && + typeof checkedValue !== "function" && + checkedValue !== "symbol"; + } + break; } @@ -8300,10 +8303,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { // This is handled by updateWrapper below. break; } + + case "defaultValue": { + lastDefaultValue = lastProp; + } // defaultChecked and defaultValue are ignored by setProp + // Fallthrough default: { - setProp(domElement, tag, propKey, null, nextProps, lastProp); + if (!nextProps.hasOwnProperty(propKey)) + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } } @@ -8472,6 +8481,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -8873,6 +8883,7 @@ function updatePropertiesWithDiff( var type = nextProps.type; var value = nextProps.value; var defaultValue = nextProps.defaultValue; + var lastDefaultValue = lastProps.defaultValue; var checked = nextProps.checked; var defaultChecked = nextProps.defaultChecked; @@ -9013,6 +9024,7 @@ function updatePropertiesWithDiff( domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -37676,7 +37688,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-50cde584"; +var ReactVersion = "18.3.0-www-classic-b1d73382"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 5fa3111e30978..9742f0d039992 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -3749,19 +3749,40 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { var node = element; + if (value != null) { + if (type === "number") { + if ( + // $FlowFixMe[incompatible-type] + (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value + ) { + node.value = toString(getToStringValue(value)); + } + } else if (node.value !== toString(getToStringValue(value))) { + node.value = toString(getToStringValue(value)); + } + } else if (type === "submit" || type === "reset") { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute("value"); + return; + } + if (disableInputAttributeSyncing) { // When not syncing the value attribute, React only assigns a new value // whenever the defaultValue React prop has changed. When not present, // React does nothing if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } else { @@ -3774,7 +3795,7 @@ function updateInput( setDefaultValue(node, type, getToStringValue(value)); } else if (defaultValue != null) { setDefaultValue(node, type, getToStringValue(defaultValue)); - } else { + } else if (lastDefaultValue != null) { node.removeAttribute("value"); } } @@ -3799,26 +3820,6 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } - - if (value != null) { - if (type === "number") { - if ( - // $FlowFixMe[incompatible-type] - (value === 0 && node.value === "") || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value - ) { - node.value = toString(getToStringValue(value)); - } - } else if (node.value !== toString(getToStringValue(value))) { - node.value = toString(getToStringValue(value)); - } - } else if (type === "submit" || type === "reset") { - // Submit/reset inputs need the attribute removed completely to avoid - // blank-text buttons. - node.removeAttribute("value"); - return; - } } function initInput( element, @@ -3944,6 +3945,7 @@ function restoreControlledInputState(element, props) { rootNode, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -3999,6 +4001,7 @@ function restoreControlledInputState(element, props) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -34192,7 +34195,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-cc5ab9ca"; +var ReactVersion = "18.3.0-www-modern-d3066f93"; function createPortal$1( children, @@ -40472,25 +40475,25 @@ function updateProperties(domElement, tag, lastProps, nextProps) { var type = null; var value = null; var defaultValue = null; + var lastDefaultValue = null; var checked = null; var defaultChecked = null; for (var propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - lastProp != null && - !nextProps.hasOwnProperty(propKey) - ) { + if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; + if (!nextProps.hasOwnProperty(propKey)) { + var checkedValue = nextProps.defaultChecked; + var inputElement = domElement; + inputElement.checked = + !!checkedValue && + typeof checkedValue !== "function" && + checkedValue !== "symbol"; + } + break; } @@ -40498,10 +40501,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { // This is handled by updateWrapper below. break; } + + case "defaultValue": { + lastDefaultValue = lastProp; + } // defaultChecked and defaultValue are ignored by setProp + // Fallthrough default: { - setProp(domElement, tag, propKey, null, nextProps, lastProp); + if (!nextProps.hasOwnProperty(propKey)) + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } } @@ -40670,6 +40679,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -41071,6 +41081,7 @@ function updatePropertiesWithDiff( var type = nextProps.type; var value = nextProps.value; var defaultValue = nextProps.defaultValue; + var lastDefaultValue = lastProps.defaultValue; var checked = nextProps.checked; var defaultChecked = nextProps.defaultChecked; @@ -41211,6 +41222,7 @@ function updatePropertiesWithDiff( domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index e384d26196775..7514b7d2615c6 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -977,19 +977,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -1000,15 +1012,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1894,27 +1897,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$36 in nextProps) { @@ -1984,6 +1988,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -1993,23 +1998,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$36 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -2021,8 +2034,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$36, propKey, value, defaultValue); return; @@ -2082,15 +2102,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { default: setProp(domElement, tag, propKey$54, null, nextProps, propKey$36); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$36 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$36 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$36 !== propKey && (null != propKey$36 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$36 && @@ -2098,7 +2118,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { "symbol" !== typeof propKey$36; break; default: - setProp(domElement, tag, checked, propKey$36, nextProps, propKey); + setProp( + domElement, + tag, + lastDefaultValue, + propKey$36, + nextProps, + propKey + ); } return; case "img": @@ -2122,29 +2149,22 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$36 && !nextProps.hasOwnProperty(propKey$59) && setProp(domElement, tag, propKey$59, null, nextProps, propKey$36); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$36 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$36 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$36 !== propKey && (null != propKey$36 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$36) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp( - domElement, - tag, - defaultChecked, - propKey$36, - nextProps, - propKey - ); + setProp(domElement, tag, checked, propKey$36, nextProps, propKey); } return; default: @@ -2162,16 +2182,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$36 ); - for (lastProp in nextProps) - (propKey$36 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$36 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$36 === propKey || (null == propKey$36 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$36, nextProps, propKey @@ -2185,13 +2205,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$36 && !nextProps.hasOwnProperty(propKey$69) && setProp(domElement, tag, propKey$69, null, nextProps, propKey$36); - for (var propKey$71 in nextProps) - (propKey$36 = nextProps[propKey$71]), - (propKey = lastProps[propKey$71]), - !nextProps.hasOwnProperty(propKey$71) || + for (lastProp in nextProps) + (propKey$36 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$36 === propKey || (null == propKey$36 && null == propKey) || - setProp(domElement, tag, propKey$71, propKey$36, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$36, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -2213,8 +2233,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -2263,44 +2284,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -2384,6 +2413,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -2410,6 +2440,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -15098,7 +15129,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1814 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-09c9197a", + version: "18.3.0-www-classic-145c42eb", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2252 = { @@ -15128,7 +15159,7 @@ var internals$jscomp$inline_2252 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-09c9197a" + reconcilerVersion: "18.3.0-www-classic-145c42eb" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2253 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17128,4 +17159,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-09c9197a"; +exports.version = "18.3.0-www-classic-145c42eb"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 8df7fc0e46eb5..89b22e02679c4 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -961,19 +961,31 @@ function updateInput( element, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type ) { + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else if ("submit" === type || "reset" === type) { + element.removeAttribute("value"); + return; + } disableInputAttributeSyncing ? null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value") + : null != lastDefaultValue && element.removeAttribute("value") : null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : element.removeAttribute("value"); + : null != lastDefaultValue && element.removeAttribute("value"); disableInputAttributeSyncing ? null == defaultChecked ? element.removeAttribute("checked") @@ -984,15 +996,6 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); - if (null != value) - if ("number" === type) { - if ((0 === value && "" === element.value) || element.value != value) - element.value = "" + getToStringValue(value); - } else - element.value !== "" + getToStringValue(value) && - (element.value = "" + getToStringValue(value)); - else - ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); } function initInput( element, @@ -1321,6 +1324,7 @@ function restoreStateOfTarget(target) { target, props.value, props.defaultValue, + props.defaultValue, props.checked, props.defaultChecked, props.type @@ -1347,6 +1351,7 @@ function restoreStateOfTarget(target) { otherNode, otherProps.value, otherProps.defaultValue, + otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, otherProps.type @@ -14800,27 +14805,28 @@ function updateProperties(domElement, tag, lastProps, nextProps) { type = null, value = null, defaultValue = null, + lastDefaultValue = null, checked = null, defaultChecked = null; for (propKey in lastProps) { var lastProp = lastProps[propKey]; - if ( - lastProps.hasOwnProperty(propKey) && - null != lastProp && - !nextProps.hasOwnProperty(propKey) - ) + if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - lastProp = nextProps.defaultChecked; - domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp; + nextProps.hasOwnProperty(propKey) || + ((lastProp = nextProps.defaultChecked), + (domElement.checked = + !!lastProp && + "function" !== typeof lastProp && + "symbol" !== lastProp)); break; case "value": break; + case "defaultValue": + lastDefaultValue = lastProp; default: - setProp(domElement, tag, propKey, null, nextProps, lastProp); + nextProps.hasOwnProperty(propKey) || + setProp(domElement, tag, propKey, null, nextProps, lastProp); } } for (var propKey$218 in nextProps) { @@ -14890,6 +14896,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, value, defaultValue, + lastDefaultValue, checked, defaultChecked, type @@ -14899,23 +14906,31 @@ function updateProperties(domElement, tag, lastProps, nextProps) { defaultValue = value = propKey = propKey$218 = null; for (type in lastProps) if ( - ((checked = lastProps[type]), - lastProps.hasOwnProperty(type) && null != checked) + ((lastDefaultValue = lastProps[type]), + lastProps.hasOwnProperty(type) && null != lastDefaultValue) ) switch (type) { case "value": break; case "multiple": - defaultValue = checked; + defaultValue = lastDefaultValue; default: nextProps.hasOwnProperty(type) || - setProp(domElement, tag, type, null, nextProps, checked); + setProp( + domElement, + tag, + type, + null, + nextProps, + lastDefaultValue + ); } for (name in nextProps) if ( ((type = nextProps[name]), - (checked = lastProps[name]), - nextProps.hasOwnProperty(name) && (null != type || null != checked)) + (lastDefaultValue = lastProps[name]), + nextProps.hasOwnProperty(name) && + (null != type || null != lastDefaultValue)) ) switch (name) { case "value": @@ -14927,8 +14942,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "multiple": value = type; default: - type !== checked && - setProp(domElement, tag, name, type, nextProps, checked); + type !== lastDefaultValue && + setProp( + domElement, + tag, + name, + type, + nextProps, + lastDefaultValue + ); } updateSelect(domElement, propKey$218, propKey, value, defaultValue); return; @@ -14995,15 +15017,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { propKey$218 ); } - for (checked in nextProps) + for (lastDefaultValue in nextProps) if ( - ((propKey$218 = nextProps[checked]), - (propKey = lastProps[checked]), - nextProps.hasOwnProperty(checked) && + ((propKey$218 = nextProps[lastDefaultValue]), + (propKey = lastProps[lastDefaultValue]), + nextProps.hasOwnProperty(lastDefaultValue) && propKey$218 !== propKey && (null != propKey$218 || null != propKey)) ) - switch (checked) { + switch (lastDefaultValue) { case "selected": domElement.selected = propKey$218 && @@ -15014,7 +15036,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - checked, + lastDefaultValue, propKey$218, nextProps, propKey @@ -15042,15 +15064,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$218 && !nextProps.hasOwnProperty(propKey$241) && setProp(domElement, tag, propKey$241, null, nextProps, propKey$218); - for (defaultChecked in nextProps) + for (checked in nextProps) if ( - ((propKey$218 = nextProps[defaultChecked]), - (propKey = lastProps[defaultChecked]), - nextProps.hasOwnProperty(defaultChecked) && + ((propKey$218 = nextProps[checked]), + (propKey = lastProps[checked]), + nextProps.hasOwnProperty(checked) && propKey$218 !== propKey && (null != propKey$218 || null != propKey)) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": if (null != propKey$218) @@ -15060,7 +15082,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - defaultChecked, + checked, propKey$218, nextProps, propKey @@ -15082,16 +15104,16 @@ function updateProperties(domElement, tag, lastProps, nextProps) { nextProps, propKey$218 ); - for (lastProp in nextProps) - (propKey$218 = nextProps[lastProp]), - (propKey = lastProps[lastProp]), - !nextProps.hasOwnProperty(lastProp) || + for (defaultChecked in nextProps) + (propKey$218 = nextProps[defaultChecked]), + (propKey = lastProps[defaultChecked]), + !nextProps.hasOwnProperty(defaultChecked) || propKey$218 === propKey || (null == propKey$218 && null == propKey) || setPropOnCustomElement( domElement, tag, - lastProp, + defaultChecked, propKey$218, nextProps, propKey @@ -15105,13 +15127,13 @@ function updateProperties(domElement, tag, lastProps, nextProps) { null != propKey$218 && !nextProps.hasOwnProperty(propKey$251) && setProp(domElement, tag, propKey$251, null, nextProps, propKey$218); - for (var propKey$253 in nextProps) - (propKey$218 = nextProps[propKey$253]), - (propKey = lastProps[propKey$253]), - !nextProps.hasOwnProperty(propKey$253) || + for (lastProp in nextProps) + (propKey$218 = nextProps[lastProp]), + (propKey = lastProps[lastProp]), + !nextProps.hasOwnProperty(lastProp) || propKey$218 === propKey || (null == propKey$218 && null == propKey) || - setProp(domElement, tag, propKey$253, propKey$218, nextProps, propKey); + setProp(domElement, tag, lastProp, propKey$218, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15133,8 +15155,9 @@ function updatePropertiesWithDiff( case "input": var name = nextProps.name, type = nextProps.type, - value = nextProps.value; - lastProps = nextProps.defaultValue; + value = nextProps.value, + defaultValue = nextProps.defaultValue; + lastProps = lastProps.defaultValue; for ( var checked = nextProps.checked, defaultChecked = nextProps.defaultChecked, @@ -15183,44 +15206,52 @@ function updatePropertiesWithDiff( "boolean" !== typeof name ? domElement.setAttribute("name", name) : domElement.removeAttribute("name"); - updateInput(domElement, value, lastProps, checked, defaultChecked, type); + updateInput( + domElement, + value, + defaultValue, + lastProps, + checked, + defaultChecked, + type + ); return; case "select": name = nextProps.value; type = nextProps.defaultValue; value = nextProps.multiple; - lastProps = lastProps.multiple; - for (checked = 0; checked < updatePayload.length; checked += 2) + defaultValue = lastProps.multiple; + for (lastProps = 0; lastProps < updatePayload.length; lastProps += 2) switch ( - ((defaultChecked = updatePayload[checked]), - (i = updatePayload[checked + 1]), - defaultChecked) + ((checked = updatePayload[lastProps]), + (defaultChecked = updatePayload[lastProps + 1]), + checked) ) { case "value": break; default: - setProp(domElement, tag, defaultChecked, i, nextProps, null); + setProp(domElement, tag, checked, defaultChecked, nextProps, null); } - updateSelect(domElement, name, type, value, lastProps); + updateSelect(domElement, name, type, value, defaultValue); return; case "textarea": name = nextProps.value; type = nextProps.defaultValue; for (value = 0; value < updatePayload.length; value += 2) switch ( - ((lastProps = updatePayload[value]), - (checked = updatePayload[value + 1]), - lastProps) + ((defaultValue = updatePayload[value]), + (lastProps = updatePayload[value + 1]), + defaultValue) ) { case "value": break; case "children": break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != lastProps) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, lastProps, checked, nextProps, null); + setProp(domElement, tag, defaultValue, lastProps, nextProps, null); } updateTextarea(domElement, name, type); return; @@ -16303,7 +16334,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1844 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-40ddfb33", + version: "18.3.0-www-modern-edf301ed", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2220 = { @@ -16334,7 +16365,7 @@ var internals$jscomp$inline_2220 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-40ddfb33" + reconcilerVersion: "18.3.0-www-modern-edf301ed" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16653,4 +16684,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-40ddfb33"; +exports.version = "18.3.0-www-modern-edf301ed"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 41c63500eb0dc..e345f9302692c 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -24355,7 +24355,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-40ddfb33"; +var ReactVersion = "18.3.0-www-modern-edf301ed"; // Might add PROFILE later.