We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bda4bc8 commit c4568bdCopy full SHA for c4568bd
a-to-z-list.js
@@ -9,6 +9,23 @@ class AtoZList extends HTMLElement {
9
10
connectedCallback() {
11
this.render();
12
+ this.setupMutationObserver();
13
+ }
14
+
15
+ setupMutationObserver() {
16
+ const observer = new MutationObserver((mutations) => {
17
+ mutations.forEach((mutation) => {
18
+ if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
19
+ this.render();
20
21
+ });
22
23
24
+ observer.observe(this, {
25
+ attributes: false,
26
+ childList: true,
27
+ subtree: true
28
29
}
30
31
render() {
0 commit comments