fix(Checkbox): label interaction without FormGroup (#1427)

This commit is contained in:
Romain Hamel
2024-02-26 12:55:30 +01:00
committed by GitHub
parent 4b6e80e364
commit 6e77f1d514

View File

@@ -39,6 +39,7 @@ import type { Strategy } from '../../types'
import appConfig from '#build/app.config'
import { checkbox } from '#ui/ui.config'
import colors from '#ui-colors'
import { useId } from '#app'
const config = mergeConfig<typeof checkbox>(appConfig.ui.strategy, appConfig.ui.checkbox, checkbox)
@@ -105,7 +106,8 @@ export default defineComponent({
setup (props, { emit }) {
const { ui, attrs } = useUI('checkbox', toRef(props, 'ui'), config, toRef(props, 'class'))
const { emitFormChange, color, name, inputId } = useFormGroup(props)
const { emitFormChange, color, name, inputId: _inputId } = useFormGroup(props)
const inputId = _inputId.value ?? useId()
const toggle = computed({
get () {