You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using Storybook to document components and during the customized Headless Input component accessbility testing, a warning about the attribute aria-invalid being empty was triggered:
The empty aria-invalid can also be seen on element inspection in the reproduction URL.
It happens due to how Headless Input currently renders the aria-invalid:
I believe that rendering this attribute with a true value ('aria-invalid': invalid ? 'true' : undefined) solves this issue, and this is probably cause by how React misshandles aria-* attributes that require a valid value (in JSX this is considered booleanish, meaning that accepts boolean, 'true' or 'false', but in HTML just ="true" or ="false" is expected)
Apparently, MDN says that any value different than 'true', 'false', 'spelling' or 'grammar' will be treated like 'true', but as we can read in the references, this attribute must have a valid value (any of the previous ones).
The text was updated successfully, but these errors were encountered:
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v2.2.0
What browser are you using?
Chrome Version 131.0.6778.265 (arm64)
Reproduction URL
CodeSandbox
Describe your issue
I'm currently using Storybook to document components and during the customized Headless Input component accessbility testing, a warning about the attribute
aria-invalid
being empty was triggered:It happens due to how Headless
Input
currently renders thearia-invalid
:Permalink
I believe that rendering this attribute with a
true
value ('aria-invalid': invalid ? 'true' : undefined
) solves this issue, and this is probably cause by how React misshandlesaria-*
attributes that require a valid value (in JSX this is considered booleanish, meaning that acceptsboolean
,'true'
or'false'
, but in HTML just ="true" or ="false" is expected)References:
Note:
Apparently, MDN says that any value different than
'true'
,'false'
,'spelling'
or'grammar'
will be treated like'true'
, but as we can read in the references, this attribute must have a valid value (any of the previous ones).The text was updated successfully, but these errors were encountered: