Skip to content

Commit 3b43f7c

Browse files
authored
move aside to correct location
1 parent 47604d6 commit 3b43f7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/lit-dev-content/site/docs/v3/components/shadow-dom.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,8 @@ You can specify fallback content for a slot. The fallback content is shown when
176176
177177
## Accessing slotted children { #accessing-slotted-children }
178178
179-
{% aside "info" %}
180-
181179
To access children assigned to slots in your shadow root, you can use the standard `slot.assignedNodes` or `slot.assignedElements` methods with the `slotchange` event.
182180
183-
{% endaside %}
184-
185181
For example, you can create a getter to access assigned elements for a particular slot:
186182
187183
```js
@@ -191,8 +187,12 @@ get _slottedChildren() {
191187
}
192188
```
193189
190+
{% aside "info" "no-header" %}
191+
194192
The elements are assigned only after the slot is rendered, so if you need to access assigned elements at startup, you need to wait for `firstUpdated` or `updated`. If you want to access assigned elements when your render changes, you can use `slotchange`.
195193
194+
{% endaside %}
195+
196196
You can use the `slotchange` event to take action when nodes are first assigned or change.
197197
The following example extracts the text content of all of the slotted children.
198198

0 commit comments

Comments
 (0)