nvda
nvda copied to clipboard
NVDA does not read error messages referenced with aria-errormessage and aria-invalid
Steps to reproduce:
In any browser (Firefox/Chrome):
- Head on over to my aria-errormessage code pen
- Enter a number that is 12 or less and click the "Test it" button.
- (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.
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?
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.
Perhaps @MichaelDCurran can respond here. Does NVDA support aria-errormessage yet? I don’t recall that it does.
Possible duplicate of #7768, but I think this one is better, as it gave @PratikP1 a working example, and is more in depth.
Seems we have a circle here: #7768 references #8318, and #8318, reference 7768. They both say it's better handled in the other.
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.
I can still reproduce this issue in NVDA 2019.1.1 on Firefox 66.0.4 and Chrome 74. cc: @feerrenrut
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.
Firefox correctly exposes aria-errormessage using IA2_RELATION_ERROR. NVDA just doesn't support this yet.
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
Looking forward for this feature.
Hope it gets implemented.
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.
This still appears to be an issue as of May 23rd 2022, is a fix expected any time soon?
+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).
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 ofgetRelationId
.- In this case, the relations to look for are
IA2_RELATION_ERROR
,IA2_RELATION_ERROR_FOR
- In this case, the relations to look for are
- 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.
- On the python side, look at
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.
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?...
This is still not fixed (tested with NVDA 2023.1 on latest versions of both Chrome and Firefox. Does the team have any update?
@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 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?