Skip to content

Commit b99386f

Browse files
committed
fix: ignore handling of unchanged disconnected element
1 parent 02ab08a commit b99386f

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/sheet.ts

+7-13
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,14 @@ export class StyleSheet extends MutationObserver {
142142
}
143143
}
144144
}
145-
} else {
146-
if (target.isConnected) {
147-
classNames.forEach((className) => {
148-
if (!oldClassNames.includes(className)) {
149-
addClassName(className);
150-
}
151-
})
152-
for (const oldClassName of oldClassNames) {
153-
if (!classNames.contains(oldClassName)) {
154-
removeClassName(oldClassName);
155-
}
145+
} else if (target.isConnected) {
146+
classNames.forEach((className) => {
147+
if (!oldClassNames.includes(className)) {
148+
addClassName(className);
156149
}
157-
} else {
158-
for (const oldClassName of oldClassNames) {
150+
})
151+
for (const oldClassName of oldClassNames) {
152+
if (!classNames.contains(oldClassName)) {
159153
removeClassName(oldClassName);
160154
}
161155
}

0 commit comments

Comments
 (0)