fix: sep searching

This commit is contained in:
riefive
2025-11-11 12:01:50 +07:00
parent 5b1c69fd77
commit 3b75c06c4b
3 changed files with 12 additions and 18 deletions
+4 -2
View File
@@ -20,6 +20,7 @@ import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
// Helpers
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { refDebounced } from '@vueuse/core'
const props = defineProps<{
isLoading?: boolean
@@ -92,8 +93,9 @@ watch(subSpecialistId, async (newValue) => {
}
})
// Watch SEP number changes to notify parent
watch(sepNumber, (newValue) => {
// Debounced SEP number watcher: emit change only after user stops typing
const debouncedSepNumber = refDebounced(sepNumber, 500)
watch(debouncedSepNumber, (newValue) => {
emit('event', 'sep-number-changed', newValue)
})