Skip to content

Commit

Permalink
[TASK] Add the aria-live attribute to let screen readers know when er…
Browse files Browse the repository at this point in the history
…ror messages appear

Related: #962
  • Loading branch information
deoostfrees committed Oct 18, 2024
1 parent ae65e5a commit 767d2f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Resources/Private/Build/JavaScript/FormValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ class Form {
errorContainer.classList.add('filled');
errorContainer.setAttribute('data-powermail-error', this.#getFieldIdentifier(field));
errorContainer.setAttribute('id', this.#getFieldIdentifier(field) + '-errormessage');
errorContainer.setAttribute('aria-live', 'polite');
field.setAttribute('aria-describedby', this.#getFieldIdentifier(field) + '-errormessage');
let errorElement = document.createElement('li');
errorContainer.appendChild(errorElement);
Expand Down

0 comments on commit 767d2f5

Please sign in to comment.