This repository was archived by the owner on Jun 20, 2025. It is now read-only.
This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Setting prop using Boolean (to trigger prop over attribute) always sets true #426
Open
Description
Using an Object form to trigger prop over attribute setting doesn't work with Boolean objects, because they always resolve to true when applied to boolean DOM properties expecting native booleans, such as checkbox.checked.
a = new Boolean( false );
console.log( !!a ); // outputs true
console.log( a.valueOf() ); // outputs false
By adding something like this to the inside of setProp, this can be easily resolved.
// Convert Boolean objects to native boolean values
if ( value instanceof Boolean ) {
value = value.valueOf();
}
Metadata
Metadata
Assignees
Labels
No labels