fix(RadioGroup): props reactivity issues (#1065)

This commit is contained in:
Romain Hamel
2023-12-06 17:15:05 +01:00
committed by GitHub
parent 1cb8df869f
commit 7196d81b4c
2 changed files with 4 additions and 3 deletions

View File

@@ -8,8 +8,8 @@ type InputProps = {
size?: string | number | symbol
color?: string
name?: string
isFieldset?: boolean
eagerValidation?: boolean
legend?: string | null
}
export const useFormGroup = (inputProps?: InputProps, config?: any) => {
@@ -20,7 +20,8 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
const inputId = ref(inputProps?.id)
onMounted(() => {
inputId.value = inputProps?.isFieldset ? undefined : inputProps?.id ?? uid()
// Remove FormGroup label bindings for RadioGroup elements to avoid label conflicts
inputId.value = inputProps?.legend === null || inputProps.legend ? undefined : inputProps?.id ?? uid()
if (formGroup) {
// Updates for="..." attribute on label if inputProps.id is provided