Skip to content

Commit

Permalink
fix: ignore handling of unchanged disconnected element
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSeage committed Nov 11, 2022
1 parent 02ab08a commit b99386f
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,14 @@ export class StyleSheet extends MutationObserver {
}
}
}
} else {
if (target.isConnected) {
classNames.forEach((className) => {
if (!oldClassNames.includes(className)) {
addClassName(className);
}
})
for (const oldClassName of oldClassNames) {
if (!classNames.contains(oldClassName)) {
removeClassName(oldClassName);
}
} else if (target.isConnected) {
classNames.forEach((className) => {
if (!oldClassNames.includes(className)) {
addClassName(className);
}
} else {
for (const oldClassName of oldClassNames) {
})
for (const oldClassName of oldClassNames) {
if (!classNames.contains(oldClassName)) {
removeClassName(oldClassName);
}
}
Expand Down

0 comments on commit b99386f

Please sign in to comment.