Skip to content

Commit 4e0a336

Browse files
authored
Move example that no longer requires a selector
1 parent 77358a8 commit 4e0a336

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/dom-testing-library/api-queries.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ The example below will find the input node for the following DOM structures:
9696
// Wrapper labels
9797
<label>Username <input /></label>
9898

99+
// Wrapper labels where the label text is in another child element
100+
<label>
101+
<span>Username</span>
102+
<input />
103+
</label>
104+
99105
// aria-label attributes
100106
// Take care because this is not a label that users can see on the page,
101107
// so the purpose of your input must be obvious to visual users.
@@ -135,12 +141,6 @@ You may also need to filter down the results of the query.
135141
For that you can use the `selector` option:
136142

137143
```js
138-
// Label containing multiple elements
139-
<label>
140-
<span>Username</span>
141-
<input />
142-
</label>
143-
144144
// Multiple elements labelled via aria-labelledby
145145
<label id="username">Username</label>
146146
<input aria-labelledby="username" />

0 commit comments

Comments
 (0)