Skip to content

Commit 317e319

Browse files
authored
docs: Update the documentation of toBeDisabled (#375)
1 parent 9b26aef commit 317e319

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,16 @@ toBeDisabled()
156156

157157
This allows you to check whether an element is disabled from the user's
158158
perspective.
159-
160-
It matches if the element is a form control and the `disabled` attribute is
161-
specified on this element or the element is a descendant of a form element with
162-
a `disabled` attribute.
163-
164159
According to the specification, the following elements can be
165-
[actually disabled](https://html.spec.whatwg.org/multipage/semantics-other.html#disabled-elements):
160+
[disabled](https://html.spec.whatwg.org/multipage/semantics-other.html#disabled-elements):
166161
`button`, `input`, `select`, `textarea`, `optgroup`, `option`, `fieldset`.
167162

163+
This custom matcher considers an element as disabled if the element is among the
164+
types of elements that can be disabled (listed above), and the `disabled`
165+
attribute is present. It will also consider the element as disabled if it's
166+
inside a parent form element that supports being disabled and has the `disabled`
167+
attribute present.
168+
168169
#### Examples
169170

170171
```html

0 commit comments

Comments
 (0)