spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: sp-help-text error message suppressed when continue typing

Open jnurthen opened this issue 2 years ago • 5 comments
trafficstars

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?

  1. Start JAWS or NVDA
  2. Go to https://studio.webcomponents.dev/preview/Tea8IMwcfLarfCQwSnxa/src?branch=Textfield-invalid-text@7fBWg9Y3wmUwOKofZzrLDd2SRAr2&p=stories
  3. Click on the first name field
  4. Type 3
  5. Note the error message is read
  6. Delete the number and type some letters into the field
  7. Type 33 into the field
  8. Note the error message is not read.

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response

jnurthen avatar Jun 27 '23 21:06 jnurthen

note this works fine with Safari+VO

jnurthen avatar Jun 27 '23 21:06 jnurthen

Do you find this to be something that would benefit from the aria-live attribute and one of its values?

Westbrook avatar Jun 27 '23 21:06 Westbrook

@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?

jnurthen avatar Jun 27 '23 21:06 jnurthen

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.

Westbrook avatar Jun 27 '23 21:06 Westbrook

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.

jnurthen avatar Jun 27 '23 22:06 jnurthen