Skip to content

Commit 20c3392

Browse files
authoredMar 26, 2025··
fix(FormField): add help to aria-describedby attribute (#3691)
1 parent a63047b commit 20c3392

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed
 

‎src/runtime/components/FormField.vue

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ provide(formFieldInjectionKey, computed(() => ({
8686
errorPattern: props.errorPattern,
8787
hint: props.hint,
8888
description: props.description,
89+
help: props.help,
8990
ariaId
9091
}) as FormFieldInjectedOptions<FormFieldProps>))
9192
</script>

‎src/runtime/composables/useFormField.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function useFormField<T>(props?: Props<T>, opts?: { bind?: boolean, defer
8080
ariaAttrs: computed(() => {
8181
if (!formField?.value) return
8282

83-
const descriptiveAttrs = ['error' as const, 'hint' as const, 'description' as const]
83+
const descriptiveAttrs = ['error' as const, 'hint' as const, 'description' as const, 'help' as const]
8484
.filter(type => formField?.value?.[type])
8585
.map(type => `${formField?.value.ariaId}-${type}`) || []
8686

‎src/runtime/types/form.ts

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export interface FormFieldInjectedOptions<T> {
8484
errorPattern?: RegExp
8585
hint?: string
8686
description?: string
87+
help?: string
8788
ariaId: string
8889
}
8990

0 commit comments

Comments
 (0)
Please sign in to comment.