Go through the toString path for booleanish strings and .name property (#26720)

This is consistent with what we used to do but not what we want to do.
This commit is contained in:
Sebastian Markbåge
2023-04-24 19:26:50 -04:00
committed by GitHub
parent 5e5342b100
commit 9ece58ebaa
2 changed files with 5 additions and 2 deletions

View File

@@ -685,7 +685,10 @@ function setProp(
if (__DEV__) {
checkAttributeStringCoercion(value, key);
}
domElement.setAttribute(key, (value: any));
domElement.setAttribute(
key,
enableTrustedTypesIntegration ? (value: any) : '' + (value: any),
);
} else {
domElement.removeAttribute(key);
}

View File

@@ -188,7 +188,7 @@ export function updateInput(
if (__DEV__) {
checkAttributeStringCoercion(name, 'name');
}
node.name = name;
node.name = toString(getToStringValue(name));
} else {
node.removeAttribute('name');
}