fix: only set attribute as property if element has setter (#13341)

pull/13342/head
Rich Harris 21 hours ago committed by GitHub
parent 78b134dec1
commit 3aa2ec0813
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: only set attribute as property if element has setter

@ -113,7 +113,7 @@ export function set_attribute(element, attribute, value, skip_warning) {
if (value == null) {
element.removeAttribute(attribute);
} else if (attribute in element && typeof value !== 'string') {
} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {
// @ts-ignore
element[attribute] = value;
} else {

Loading…
Cancel
Save