The error-visible attribute controls the presentational aspect of a component being in an error state. Besides the visual aspects of that presentation, it should also manage the ARIA attributes to communicate that accessibly.
💁 Possible Solution
set aria-invalid="true" on the accessible element when error-visible is set on the host element
if error-visible is set and error-text is non-empty, set aria-errormessage to the id of the element with the error text
🐛 Bug Report
The
error-visible
attribute controls the presentational aspect of a component being in an error state. Besides the visual aspects of that presentation, it should also manage the ARIA attributes to communicate that accessibly.💁 Possible Solution
aria-invalid="true"
on the accessible element whenerror-visible
is set on the host elementerror-visible
is set anderror-text
is non-empty, setaria-errormessage
to theid
of the element with the error textaria-live
on the error text element🔦 Context
Came up during research for the required input feature. See https://github.com/ni/nimble/pull/2425#discussion_r1785056374