spectrum-web-components
spectrum-web-components copied to clipboard
[Bug]: sp-help-text error message suppressed when continue typing
Code of conduct
- [X] I agree to follow this project's code of conduct.
Impacted component(s)
sp-help-text
Expected behavior
When sp-help-text is used in the negative-help-text slot it is expected that the error message will be read to the user. This works great if the user simply presses a single keypress but when the user types more info into the field the error message is supressed.
Actual behavior
The error message doesn't get read as it its reading is suppressed by the next keypress.
Screenshots
No response
What browsers are you seeing the problem in?
Firefox, Chrome, Microsoft Edge
How can we reproduce this issue?
- Start JAWS or NVDA
- Go to https://studio.webcomponents.dev/preview/Tea8IMwcfLarfCQwSnxa/src?branch=Textfield-invalid-text@7fBWg9Y3wmUwOKofZzrLDd2SRAr2&p=stories
- Click on the first name field
- Type 3
- Note the error message is read
- Delete the number and type some letters into the field
- Type 33 into the field
- Note the error message is not read.
Sample code that illustrates the problem
No response
Logs taken while reproducing problem
No response
note this works fine with Safari+VO
Do you find this to be something that would benefit from the aria-live attribute and one of its values?
@Westbrook not sure - are you doing anything special to make this get read at the moment or is it merely a consequence of setting invalid which makes the message get read?
We're not doing much special here, no. I think it's mainly because it's associated to the focused element via aria-describedby. So, maybe something more insistent would be useful.
A live region of some sort could also solve the issue on iOS where the error message is not read at all (until you refocus into the field anyway) It is certainly worth investigating although I'd love to solve this in a more standards compliant way.
FYI react-spectrum has the same issue but I didn't pick it up in their audit due to their documentation testcases for errors not allowing more than a single digit. I'd like all of us to converge on the same solution.