Attempt to set read-only props using attr.

Fixes https://github.com/sveltejs/svelte/issues/2732
pull/2808/head
Brian Takita 6 years ago
parent d548a5a5f4
commit de131e48c6

@ -93,7 +93,11 @@ export function set_attributes(node, attributes) {
if (key === 'style') { if (key === 'style') {
node.style.cssText = attributes[key]; node.style.cssText = attributes[key];
} else if (key in node) { } else if (key in node) {
try {
node[key] = attributes[key]; node[key] = attributes[key];
} catch (e) {
attr(node, key, attributes[key]);
}
} else { } else {
attr(node, key, attributes[key]); attr(node, key, attributes[key]);
} }

Loading…
Cancel
Save