Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form-fields: After a first failed submission, if user submits again before resolving all errors, no live announcement gets made #155

Open
jfhector opened this issue Feb 2, 2021 · 3 comments
Labels
accepted This issue will be worked on improvement Something could be a bit better suggestion

Comments

@jfhector
Copy link

jfhector commented Feb 2, 2021

How to reproduce

  1. Go to https://bbc.github.io/gel/components/demos/form-fields/
  2. Turn on screen reader
  3. Activate the 'Submit' button (without filling in any of the fields)
  4. Correct one of the errors (but not all of them)
  5. Activate the 'Submit' button again

Expected behaviour

I expected the "Error: Please fix the errors in the form before continuing" live announcement to be made again.

Actual behaviour

No live announcement happens.

Tested in

macOS 10.15.5 Safari + VoiceOver

Likely cause

If the user doesn't correct all the errors, the content of the live region is unchanged.
So no new live announcement gets made when the user attempts Submit again.

Why that's a UX issue

We can't assume that a user would solve all errors before attempting submission again.

Potential solutions

Option A: Empty the content of the live region when users press 'Submit', before populating it again if there's an error

Example: https://www.kooth.com/login
(Note: I realise that this example has other problems – e.g. HTML5 validation when fields are empty).

Downsides of Option A
  • Small layout shift
  • I imagine that the live region will need to stay empty for some time (I think it's 100ms, if I remember well from the DequeUniversity courses, but it might be longer).

Other ideas

There are probably other ways to solve this issue.

Note

I've taking the time to report and think of solutions, because I like your work and I'd need to figure out a way to solve that issue as I implement that pattern on kooth.com too.

@micmath micmath added accepted This issue will be worked on improvement Something could be a bit better suggestion labels Feb 3, 2021
@micmath
Copy link
Contributor

micmath commented Feb 3, 2021

To clarify, text and the visual display of the message are working as expected, the issue to fix is the fact that the message is not re-announced by SR on subsequent failed submits.

@micmath
Copy link
Contributor

micmath commented Feb 3, 2021

The suggestion of emptying the live region for a moment before setting the new text seems to work in forcing the SR to re-announce the text, even if it is the same text. see https://jsfiddle.net/qvy9Lxwj/

@micmath
Copy link
Contributor

micmath commented Feb 3, 2021

The place to fix seems to be

var message = allErrors.length > 0 ? settings.prefix + ' ' + settings.warning : '';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue will be worked on improvement Something could be a bit better suggestion
Projects
None yet
Development

No branches or pull requests

2 participants