Skip to content

Commit c1e4d7a

Browse files
committed
fix: scan observer target classList with observer type of childList
1 parent 7b6d7d9 commit c1e4d7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ window.addEventListener("load", function() {
5252

5353

5454
// // console.log('ccCSS observer start', performance.now())
55+
56+
hasChange = addParsingClassList(mutation.target.classList);
5557
if (mutation.type == "childList")
5658
mutation.target.querySelectorAll("*").forEach((el) => {
5759
hasChange = addParsingClassList(el.classList) || hasChange;
5860
});
59-
else
60-
hasChange = addParsingClassList(mutation.target.classList);
61+
62+
6163
// styleList.forEach(i => styleElSheet.insertRule(i))
6264
addNewRules()
6365

0 commit comments

Comments
 (0)