Skip to content

Commit d65c739

Browse files
Switch ARIA live roles around (#162)
I think it's better for the 'Saving' message to be 'polite' but the error message to be 'assertive' - however we will test this.
1 parent b85b66b commit d65c739

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/views/button-states.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h2 class="nhsuk-heading-m">Example showing server down (503)</h2>
6969
button.disabled = true
7070
button.classList.add('app-button--loading')
7171
button.textContent = 'Saving'
72-
button.setAttribute('aria-live', 'assertive')
72+
button.setAttribute('aria-live', 'polite')
7373
button.setAttribute('aria-label', 'Saving')
7474

7575
let errorMessageElement = button.parentElement.querySelector('.app-body--error')
@@ -86,7 +86,7 @@ <h2 class="nhsuk-heading-m">Example showing server down (503)</h2>
8686
this.classList.remove('app-button--loading')
8787
this.removeAttribute('aria-live')
8888
this.removeAttribute('aria-label')
89-
this.insertAdjacentHTML("beforebegin", '<p class="app-body--error" aria-live="polite">' + errorMessage + '</p>')
89+
this.insertAdjacentHTML("beforebegin", '<p class="app-body--error" aria-live="assertive">' + errorMessage + '</p>')
9090
}.bind(event.target), randomTimeOut)
9191

9292
}

0 commit comments

Comments
 (0)