mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 06:51:46 +01:00
fix(RadioGroup): props reactivity issues (#1065)
This commit is contained in:
@@ -99,7 +99,7 @@ export default defineComponent({
|
||||
const { ui, attrs } = useUI('radioGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
|
||||
const { ui: uiRadio } = useUI('radio', toRef(props, 'uiRadio'), configRadio)
|
||||
|
||||
const { emitFormChange, color, name } = useFormGroup({ ...props, isFieldset: true }, config)
|
||||
const { emitFormChange, color, name } = useFormGroup(props, config)
|
||||
provide('radio-group', { color, name })
|
||||
|
||||
const onUpdate = (value: any) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user