nvda icon indicating copy to clipboard operation
nvda copied to clipboard

NVDA does not read error messages referenced with aria-errormessage and aria-invalid

Open Wildebrew opened this issue 6 years ago • 20 comments

Steps to reproduce:

In any browser (Firefox/Chrome):

  1. Head on over to my aria-errormessage code pen
  2. Enter a number that is 12 or less and click the "Test it" button.
  3. (optionally) you can move focus away from and back to the input field.

In the code aria-invalid gets set to true on the input and the error message is displayed (it is already connected using aria-errormessage).

Expected behavior:

When aria-invalid is set to true on a form field the screen reader should read any error message id referenced from the input field using aria-errormessage.

NVDA would read the error message after the label and value of the form field (similar to how it would be if it were referenced with aria-describedby), possibly adding a word like "error message" or "error".

Actual behavior:

NVDA does not read the error message when the invalid input is focused.

System configuration:

NVDA version: 2018.1 (with IE11, Chrome 65 and Firefox 52-ESR), was not able to test on latest Firefox build.

NVDA Installed or portable: Installed

Other information:

Windows version:

Windows 7 and 8 tested.

Name and version of other software in use when reproducing the issue:

Tested with the major browsers on Windows (see above).

Other questions:

N/A.

Wildebrew avatar May 21 '18 19:05 Wildebrew

When a number <= 12 is typed and and “test it” button is activated, focus returns to the field and “invalid entry” is announced along with the number that was input. What exact behavior would you want to see here?

PratikP1 avatar May 21 '18 20:05 PratikP1

NVDA should also read the error message that is displayed below the field "the number you typed is not greater than 12". The invalid announcement comes from use of aria-invalid, but I don't see the aria-errormessage attribute being communicated.

The error message referenced with aria-errormessage could be read automatically or there should be a shortcut key to read the error message on demand with focus on the input field.

On 5/21/18, PratikP1 [email protected] wrote:

When a number <= 12 is typed and and “test it” button is activated, focus returns to the field and “invalid entry” is announced along with the number that was input. What exact behavior would you want to see here?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/8318#issuecomment-390775754

-- Work hard. Have fun. Make history.

Wildebrew avatar May 21 '18 20:05 Wildebrew

Perhaps @MichaelDCurran can respond here. Does NVDA support aria-errormessage yet? I don’t recall that it does.

PratikP1 avatar May 21 '18 20:05 PratikP1

Possible duplicate of #7768, but I think this one is better, as it gave @PratikP1 a working example, and is more in depth.

aosheter avatar May 29 '18 12:05 aosheter

Seems we have a circle here: #7768 references #8318, and #8318, reference 7768. They both say it's better handled in the other.

DavidMacDonald avatar Jul 17 '18 15:07 DavidMacDonald

I don't really care about the issue number, but I do care that we settle on a solution and hope the good people at NVDA can find time to implement it (I know it takes time and I totally respect that). We want to use aria-errormessage so that we can hardcode the error association in the template and then activate it by setting aria-invalid to true on the field when it is in error. This can't be done with aria-describedby because the contents of its target are read regardless of visibility (in other words, a hidden error message referenced with aria-described by is always announced). But until aria-errormessage has better support we can't implement this solution.

On 7/17/18, David MacDonald [email protected] wrote:

Seems we have a circle here: #7768 references #8318, and #8318, reference 7768. They both say it's better handled in the other.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/8318#issuecomment-405618407

-- Work hard. Have fun. Make history.

Wildebrew avatar Jul 18 '18 11:07 Wildebrew

I can still reproduce this issue in NVDA 2019.1.1 on Firefox 66.0.4 and Chrome 74. cc: @feerrenrut

Adriani90 avatar May 08 '19 14:05 Adriani90

Still reproducible in Firefox 76.0.1 and Chrome 81. cc: @jcsteh, @aleventhal maybe you have some suggestions here, I think many authors implement aria-errormessage like this but I am not sure if this violates the Aria spec.

Adriani90 avatar May 09 '20 10:05 Adriani90

Firefox correctly exposes aria-errormessage using IA2_RELATION_ERROR. NVDA just doesn't support this yet.

jcsteh avatar May 11 '20 00:05 jcsteh

I faced this issue today too and I tought it was due to my wrong code. Can someone suggest a reader that supports it so I can test my HTML? @Wildebrew Thanks for your example

Anubarak avatar Apr 23 '21 14:04 Anubarak

Looking forward for this feature.

woody-li avatar Aug 10 '21 09:08 woody-li

Hope it gets implemented.

Miguelklappes avatar Sep 01 '21 18:09 Miguelklappes

Similar to what James Teh mentioned, I don't believe this requires anything on the Chrome side. Chrome implements aria-errormessage and aria-invalid via the CORE-AAM spec, e.g. relations IA2_RELATION_ERROR and IA2_RELATION_ERROR_FOR.

aleventhal avatar Sep 01 '21 18:09 aleventhal

This still appears to be an issue as of May 23rd 2022, is a fix expected any time soon?

james-hill-kc avatar May 23 '22 16:05 james-hill-kc

+1 for prioritizing this. JAWS supports aria-errormessage and reads it very nicely, NVDA doesn't. Even though NVDA is the primary screen reader for which we optimize our application, that doesn't mean we can ignore the aria specification (which for good reasons recommends the use of aria-errormessage rather than aria-describedby in this situation).

timveld avatar Oct 20 '22 10:10 timveld

Technical notes to aide anyone willing to take this on:

Look at other fetched relations:

  • Expose the value from the virtual buffer (nvdaHelper C++ code) look at usages of getRelationId.
    • In this case, the relations to look for are IA2_RELATION_ERROR, IA2_RELATION_ERROR_FOR
  • Other examples to follow: IA2_RELATION_DETAILS / IA2_RELATION_LABELLED_BY
    • On the python side, look at def hasDetails, def _get_detailsSummary work / are used.

In this case, it is probably most user friendly to report the error automatically. However, it should be noted that when the error is displayed and exposed to AT there is the risk of reporting the error twice. To remedy these situations, look at how "labelledByContent" works.

feerrenrut avatar Oct 21 '22 03:10 feerrenrut

Is this not yet fixed?... I am currently using orca for development reasons and I did not expect that the same issue was to be found in NVDA, can I use described-by instead?...

onzag avatar Nov 13 '22 15:11 onzag

This is still not fixed (tested with NVDA 2023.1 on latest versions of both Chrome and Firefox. Does the team have any update?

Wildebrew avatar Aug 18 '23 03:08 Wildebrew

@seanbudd, @gerald-hartig it seems the demand for this from several web developers is quite high even though there is also a discussion on deprecating this role. I think it makes sense to implement support for this in NVDA given this role has already been used in the design of several websites or applications. At the same time, there are also several bugs in NvDA with regards to aria role alert which is also used to announce error messages. So to give the user the highest level of accessibility, both alert and errormessage roles should be fully supported in NVDA.

Can you estimate how much effort it would mean to solve this issue at least?

Adriani90 avatar Jan 31 '24 21:01 Adriani90

@Adriani90 we've recently started a push to improve our ARIA compatibility. This issue is right at the top of our list to resolve, and we have a specific release in mind for resolution of this one, but I'd like to hold off a bit before making any firm statements around timing. Are there any ARIA issues apart from this one you think we need to tackle as an immediate priority?

gerald-hartig avatar Jan 31 '24 21:01 gerald-hartig