Open andrecasal opened 1 year ago
Thanks a lot for the report. Adding this to the team's backlog for prioritization and investigation.
It seems to be the problem that the webhint engine expects true or false as values and not the variable you have in there right now. This is a tricky thing to work around as ARIA values are defined, and we can't know that your expression will have the right value or not. This is a wontfix, I'm afraid, but you can use the "Quick fix" option to not get this error report any more.
@codepo8, out of curiosity, wouldn't it be possible to access the aria-invalid={Boolean(actionData?.fieldErrors?.email)}
expression slot and check if typeof is boolean? If so, disable the error.
@codepo8 Not sure I see the utility of a rule that accepts only true
/false
and not an expression, in many cases an attribute like this is going to be dynamic and is going to be controlled by an expression. For anyone working on Javascript (or any other language or framework that converts to Javascript) this often will become an expression.
Can't @andrecasal fix be used? or as he suggests disable the error? Or maybe turn it into a warning?
To me this looks like an engine limitation not an accessibility issue. If the only solution is to totally disable this hint, why have it on the first place?
I have to agree with this, and will re-open this issue. Even though this might be a technically complex one to fix, I do think it makes sense to keep it on the backlog.
I believe this error also exists in this case:
IDs used in ARIA and labels must be unique: Document has multiple elements referenced with ARIA with the same id attribute: {expression}
Even though, I'm doing this:
<span id={`${uniqueId}-helperText`}>{helperText}</span>
<span id={`${uniqueId}-errorMessage`} role="alert">{error.message}</span>
Environment (please complete the following information):
Describe the bug:
"ARIA attributes must conform to valid values: Invalid ARIA attribute value: aria-invalid="{expression}" Microsoft Edge Tools axe/aria" shows up on valid aria-invalid expression.
Repro steps:
Expected behavior:
Expected the error to not show up.
Additional context: