Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aria-describedby reports referencing error, for empty spans that will have error messages. #1151

Closed
DavidMacDonald opened this issue Sep 18, 2018 · 12 comments
Assignees
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Milestone

Comments

@DavidMacDonald
Copy link

DavidMacDonald commented Sep 18, 2018

A site has gets injected with a span that is populated with an error message if the user submits the form without filling in the field that is required. Axe reporting an aria-describedby error.

Invalid ARIA attribute value: aria-describedby="giftCard_0Error"

<input id="giftCard_0" aria-describedby="giftCard_0Error" aria-invalid="false" ...

Because there is no corresponding element with a matching id until the user makes an error and submits.
does it require an empty span?
<span id="giftCard_0Error" aria-live="polite">[nothing here yet]></span>

I wonder if there is some way to make the aria-describedby message conditional to the presence of an error message?? Not sure, but its a false positive as it stands.

@WilcoFiers
Copy link
Contributor

Hey David. Thanks for reporting. This is something I've been thinking about myself. I don't think axe should just pass when IDREFs don't exist, but I think it might be worth putting it into review. Certainly this seems like a false positive to me, so I think we should treat it that way and work out a fix for it.

I'm actually inclined to no longer put requirements on ARIA idrefs attributes, and to only require that an idref attribute doesn't have a space (as those aren't allowed in IDs). We can than have a separate rule testing that IDREF targets exist. WDYT?

@WilcoFiers WilcoFiers added the fix Bug fixes label Sep 20, 2018
@DavidMacDonald
Copy link
Author

I think its valuable to check that there is a matching id. Its fine if its a separate check. However, I think perhaps downgrading the check for corresponding id if the aria-describedby on a input type="text" to needs manual conformation.

@WilcoFiers WilcoFiers added the rules Issue or false result from an axe-core rule label Oct 18, 2018
@WilcoFiers WilcoFiers added this to the Axe-core 3.4 milestone Jun 7, 2019
@straker straker self-assigned this Jul 3, 2019
@jeankaplansky
Copy link
Contributor

@WilcoFiers , @straker : Please confirm - no new documentation required here until we create a new rule specifically testing the IDREF? Thanks.

@straker
Copy link
Contributor

straker commented Jul 11, 2019

@jeankaplansky Correct. No new documentation required.

@jeankaplansky
Copy link
Contributor

👍 Thanks!

@chandana7393
Copy link

Tested, under "We are not sure this is an issue, because:" observed that for ARIA attribute unable to see the value instead some condition is displayed.
checking_id_ref
Tested Environment:
Attest - 2.5.1.21115v
Axe - 3.8.1.21115v
Axe-coconut - 3.8.1.21104v
Chrome - 75.0.3770.142v
OS - Windows 10 64 bit

@somaalapati
Copy link

@chandana7393 I hope you can verify it now.

@chandana7393
Copy link

Tested, working fine on axe-coconut.
ref_id
For Attest and axe under "We are not sure this is an issue, because:" observed that for ARIA attribute unable to see the value instead some condition is displayed.
axe_id_ref
Attest_id_ref
Tested Environment:
Attest - 2.5.1.21421v
Axe - 3.8.1.21421v
Axe-coconut - 3.8.1.21704v
Chrome - 76.0.3809.87v
Firefox - 68.0.1v
OS - Windows 10 64 bit.

@straker
Copy link
Contributor

straker commented Aug 6, 2019

@WilcoFiers we need to create another release of axe-core to fix the incomplete translation message for all downstream dependencies.

@straker
Copy link
Contributor

straker commented Aug 8, 2019

@chandana7393 since this requires a new version of axe and Attest to pull it in, could we close this issue as the problem has been resolved for axe?

@chandana7393
Copy link

Tested, working as expected in axe-coconut.
![check_ref_axe_coconut](https://user-images.githubusercontent.com/45285854/62767015-5e903e80-bab1-11e9-916f-ab82be163acc.PNG
Tested Environment:
Axe-coconut - 3.8.1.21704v
Chrome - 76.0.3809.100v
OS - Windows 10 64 bit.
Created new ticket for Axe and Attest
#1761

@iamrafan
Copy link
Contributor

iamrafan commented Apr 3, 2020

@WilcoFiers @straker : The intended fix for this issue is not working as expected. Case-1 in the below samples does not show up as "needs review'.

Demo: https://codepen.io/iamrafan/pen/abOrzVb?editors=1000

aria-describedby referenced to an empty <span> is now not a failure but it does not show up as 'needs review' as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

7 participants