|
|
@@ -13,10 +13,19 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
|
|
|
const currentDisplay = style.display
|
|
|
let hasControlledDisplay = false
|
|
|
if (next && !isCssString) {
|
|
|
- if (prev && !isString(prev)) {
|
|
|
- for (const key in prev) {
|
|
|
- if (next[key] == null) {
|
|
|
- setStyle(style, key, '')
|
|
|
+ if (prev) {
|
|
|
+ if (!isString(prev)) {
|
|
|
+ for (const key in prev) {
|
|
|
+ if (next[key] == null) {
|
|
|
+ setStyle(style, key, '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (const prevStyle of prev.split(';')) {
|
|
|
+ const key = prevStyle.slice(0, prevStyle.indexOf(':')).trim()
|
|
|
+ if (next[key] == null) {
|
|
|
+ setStyle(style, key, '')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|