mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(FormField): add help to aria-describedby attribute (#3691)
This commit is contained in:
@@ -86,6 +86,7 @@ provide(formFieldInjectionKey, computed(() => ({
|
||||
errorPattern: props.errorPattern,
|
||||
hint: props.hint,
|
||||
description: props.description,
|
||||
help: props.help,
|
||||
ariaId
|
||||
}) as FormFieldInjectedOptions<FormFieldProps>))
|
||||
</script>
|
||||
|
||||
@@ -80,7 +80,7 @@ export function useFormField<T>(props?: Props<T>, opts?: { bind?: boolean, defer
|
||||
ariaAttrs: computed(() => {
|
||||
if (!formField?.value) return
|
||||
|
||||
const descriptiveAttrs = ['error' as const, 'hint' as const, 'description' as const]
|
||||
const descriptiveAttrs = ['error' as const, 'hint' as const, 'description' as const, 'help' as const]
|
||||
.filter(type => formField?.value?.[type])
|
||||
.map(type => `${formField?.value.ariaId}-${type}`) || []
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ export interface FormFieldInjectedOptions<T> {
|
||||
errorPattern?: RegExp
|
||||
hint?: string
|
||||
description?: string
|
||||
help?: string
|
||||
ariaId: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user