feat(Form): Select and InputMenu integration (#97)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2024-05-10 12:53:52 +02:00
committed by GitHub
parent 810d278ea7
commit 52cf471099
14 changed files with 82 additions and 89 deletions

View File

@@ -75,13 +75,6 @@ const ui = computed(() => tv({ extend: checkbox, slots: props.ui })({
checked: modelValue.value ?? props.defaultValue,
indeterminate: indeterminate.value
}))
// FIXME: I think there's a race condition between this and the v-model event.
// This must be triggered after the value updates, otherwise the form validates
// the previous value.
function onChecked() {
emitFormChange()
}
</script>
<template>
@@ -95,7 +88,7 @@ function onChecked() {
:name="name"
:disabled="disabled"
:class="ui.base()"
@update:checked="onChecked"
@update:checked="emitFormChange()"
>
<CheckboxIndicator as-child>
<UIcon v-if="indeterminate" :name="indeterminateIcon || appConfig.ui.icons.minus" :class="ui.icon()" />