A11y for GlFormGroup: Error message doesn't seem to get announced to user
As discovered in this comment gitlab-org/gitlab!179129 (comment 2314594066):
- Speaking of validation text, it doesn't get announced when a user enters something with an incorrect format, so it will be unclear how to remedy.
@justin_ho:
I tried looking into it and it seems we are using aria-live="assertive" provided by GitLab UI which should announce the error immediately but I also found this article https://tetralogical.com/blog/2024/05/01/why-are-my-live-regions-not-working/. It seems that we are doing something that won't work:
Live regions that are already "populated" don't work One developer misstep that we often see with live regions is the use of containers that are already "populated" – live regions that already have content inside them that is meant to be announced by screen readers.
In some cases, developers include a live region directly in their page's markup, expecting it to be announced when the page is loaded.
We should look into this and see if it's actually an issue and if needs to be fixed.