Announce login + change-password errors to screen readers

Both the login error banner and the change-password error banner
appeared silently from a screen reader's perspective — when an auth
failure or validation error came back, the visible message rendered
but no announcement fired.

Add `role="alert"` + `aria-live="assertive"` to both. The role+live
combination ensures the message text is announced as soon as it
appears, even if the user's focus is on the input field. Visual
behavior is unchanged.

This is the start of an aria-live pass — there are no live regions
anywhere in the codebase right now, and these two surfaces (login
failure, password-change failure) are the highest-priority places
to start because the user has just performed an action and needs
immediate feedback.
This commit is contained in:
rcourtman
2026-05-10 14:46:51 +01:00
parent 76832797f4
commit df56a1f14f
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -529,6 +529,8 @@ const LoginForm: Component<{
<Show when={error()}>
<div
role="alert"
aria-live="assertive"
class={`rounded-md p-4 ${
error().includes('locked')
? 'bg-orange-50 dark:bg-orange-900'
@@ -174,7 +174,11 @@ export const ChangePasswordModal: Component<ChangePasswordModalProps> = (props)
</div>
<Show when={error()}>
<div class="p-3 bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-800 rounded-md">
<div
role="alert"
aria-live="assertive"
class="p-3 bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-800 rounded-md"
>
<p class="text-sm text-red-600 dark:text-red-400">{error()}</p>
</div>
</Show>