feat(Form): global errors (#3482)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2025-03-11 14:50:36 +01:00
committed by GitHub
parent 5ecd2271ca
commit 6e03d9c6ef
3 changed files with 7 additions and 7 deletions

View File

@@ -63,7 +63,7 @@ const ui = computed(() => formField({
const formErrors = inject<Ref<FormError[]> | null>('form-errors', null)
const error = computed(() => props.error || formErrors?.value?.find(error => error.name === props.name || (props.errorPattern && error.name.match(props.errorPattern)))?.message)
const error = computed(() => props.error || formErrors?.value?.find(error => error.name && (error.name === props.name || (props.errorPattern && error.name.match(props.errorPattern))))?.message)
const id = ref(useId())
// Copies id's initial value to bind aria-attributes such as aria-describedby.