Skip to content
Open
Changes from 1 commit
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.

It may also be necessary to disable the rule when the custom element is appended to the DOM via JavaScript like for instance the Vue framework, which appends the element including all children at once and a `MutationObserver` would not receive any `childList` mutations in such cases.