Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/rules/no-child-traversal-in-connectedcallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FooBarElement extends HTMLElement {
if (button) {
button.disabled = true
}
}).observe(this)
}).observe(this, {childList: true})
}
}
```
Expand All @@ -52,3 +52,5 @@ class FooBarElement extends HTMLElement {
## When Not To Use It

If you are comfortable with the edge cases of DOM traversal directly in the `connectedCallback` then you can disable this rule.

If your element is appended to the DOM via `.innerHTML` or similar methods, you may need to disable this rule because in such a case, the children are are available during `connectedCallback` and no mutations events will fire.