diff --git a/docs/queries/byrole.mdx b/docs/queries/byrole.mdx index 265d741d..a5109aad 100644 --- a/docs/queries/byrole.mdx +++ b/docs/queries/byrole.mdx @@ -25,6 +25,7 @@ getByRole( pressed?: boolean, suggest?: boolean, current?: boolean | string, + disabled?: boolean, expanded?: boolean, queryFallbacks?: boolean, level?: number, @@ -164,6 +165,28 @@ the "👎" by calling `getByRole('link', { current: false })`. To learn more abo the current state see [ARIA `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current). +### `disabled` + +You can filter elements by their disabled state by setting `disabled: true` or +`disabled: false`. + +For example in + +```html + +
+ +
Failed to login +
+ +``` + +you can get the "Login" button by calling +`getByRole('button', { disabled: true })`. To learn more about the disabled +state see +[ARIA `aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed) and +[MDN `disabled` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled). + ### `pressed` Buttons can have a pressed state. You can filter the returned elements by their