Development warnings
The primitives and the kit check a few accessibility rules in development builds and report them with console.warn.
The primitives and the kit check a few accessibility rules in development builds and report them with
console.warn. A warning names the rule in brackets and explains which component needs attention:
| Warning | Where | What to do |
|---|---|---|
[primitives DIALOG_LABEL] |
A Dialog.Content (or alert dialog) with no Dialog.Title, aria-label or aria-labelledby |
Render a Dialog.Title, or pass a name. The check waits for the mount flush, so a title that mounts in the same flush counts. |
[primitives SLIDER_LABEL] |
A Slider.Thumb with no name |
Pass aria-label or aria-labelledby to each thumb. Two thumbs need two names. |
[primitives PROGRESS_INVALID_MAX] |
A Progress with a max that is not greater than 0 |
Pass a positive maximum. The bar falls back to 100. |
[primitives PROGRESS_INVALID_VALUE] |
A Progress value outside 0 to max, or not a number (and not null) |
Clamp the value. The bar is shown as indeterminate until it is valid. |
[primitives TOAST_TYPE] |
A toast with a type other than foreground or background |
Pass one of the two. The toast falls back to foreground. |
[primitives TOAST_ACTION_ALT_TEXT] |
A Toast.Action with an empty altText |
Give altText the words a screen reader should announce in place of the button. |
[primitives SELECT_EMPTY_ITEM_VALUE] |
A Select.Item whose value is the empty string |
Use a non-empty value. The empty string is how the select clears its value. |
[primitives CONTROLLED_CHANGE] |
A component switches between controlled (value given) and uncontrolled during its lifetime |
Decide once: keep value present for the component's whole life, or never pass it. |