fix: style value not remove when become undefined

pull/8517/head
xxkl1 3 years ago
parent fbef42f752
commit f83707adbc

@ -641,7 +641,7 @@ export function set_input_type(input, type) {
} }
export function set_style(node, key, value, important) { export function set_style(node, key, value, important) {
if (value === null) { if (value === null || value === undefined) {
node.style.removeProperty(key); node.style.removeProperty(key);
} else { } else {
node.style.setProperty(key, value, important ? 'important' : ''); node.style.setProperty(key, value, important ? 'important' : '');

Loading…
Cancel
Save