Compare commits

...

1 Commits

Author SHA1 Message Date
Jonas Plum
96b7a9604c fix: multi select state handling (#1094) 2024-08-05 15:22:01 +02:00
2 changed files with 4 additions and 13 deletions

View File

@@ -1,24 +1,14 @@
<script setup lang="ts">
import { Textarea } from '@/components/ui/textarea'
import { useVModel } from '@vueuse/core'
import { type HTMLAttributes, onMounted, ref } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
defaultValue?: string | number
modelValue?: string | number
}>()
const emits = defineEmits<{
(e: 'update:modelValue', payload: string | number): void
}>()
const modelValue = useVModel(props, 'modelValue', emits, {
passive: true,
defaultValue: props.defaultValue
const modelValue = defineModel<string>({
default: ''
})
const textarea = ref<HTMLElement | null>(null)

View File

@@ -32,7 +32,8 @@ const selectedItems = ref<string[]>(props.modelValue)
watch(
() => selectedItems.value,
(value) => emit('update:modelValue', value)
(value) => emit('update:modelValue', value),
{ deep: true }
)
const filteredItems = computed(() => {