diff options
Diffstat (limited to 'code/app/src/lib/components/input.svelte')
| -rw-r--r-- | code/app/src/lib/components/input.svelte | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/code/app/src/lib/components/input.svelte b/code/app/src/lib/components/input.svelte index ac01348..80b1543 100644 --- a/code/app/src/lib/components/input.svelte +++ b/code/app/src/lib/components/input.svelte @@ -1,6 +1,7 @@ <script lang="ts"> import pwKey from "$actions/pwKey"; import { random_string } from "$lib/helpers"; + import { error } from "@sveltejs/kit"; import { ExclamationCircleIcon } from "./icons"; export let label: string | undefined = undefined; @@ -24,8 +25,8 @@ $: ariaErrorDescribedBy = id + "__" + "error"; $: attributes = { - "aria-describedby": errorText ? ariaErrorDescribedBy : null, - "aria-invalid": errorText ? "true" : null, + "aria-describedby": errorText || errors?.length ? ariaErrorDescribedBy : null, + "aria-invalid": errorText || errors?.length ? "true" : null, disabled: disabled || null, autocomplete: autocomplete || null, required: required || null, |
