From 8224af82be9f10bfc7e4ff7d1020d9c631f5a454 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 Nov 2023 17:03:15 +0530 Subject: [PATCH] fix: Link control was showing only 20 records --- frontend/src/components/Controls/Link.vue | 8 ++++++-- frontend/src/components/frappe-ui/Autocomplete.vue | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Controls/Link.vue b/frontend/src/components/Controls/Link.vue index 3e2738bf..1588df1a 100644 --- a/frontend/src/components/Controls/Link.vue +++ b/frontend/src/components/Controls/Link.vue @@ -4,6 +4,7 @@ {{ attrs.label }} import { call } from 'frappe-ui' import Autocomplete from '@/components/frappe-ui/Autocomplete.vue' -import { useAttrs, computed } from 'vue' +import { useAttrs, computed, ref } from 'vue' import { computedAsync } from '@vueuse/core' const props = defineProps({ @@ -39,9 +40,12 @@ const value = computed({ set: (val) => emit('update:modelValue', val?.value), }) +const autocomplete = ref(null) +const text = computed(() => autocomplete.value?.query) + const options = computedAsync(async () => { let options = await call('frappe.desk.search.search_link', { - txt: '', + txt: text.value || '', doctype: props.doctype, }) return options?.map((option) => { diff --git a/frontend/src/components/frappe-ui/Autocomplete.vue b/frontend/src/components/frappe-ui/Autocomplete.vue index ed581bb2..9e641b9a 100644 --- a/frontend/src/components/frappe-ui/Autocomplete.vue +++ b/frontend/src/components/frappe-ui/Autocomplete.vue @@ -248,4 +248,6 @@ const inputClasses = computed(() => { 'transition-colors w-full', ] }) + +defineExpose({ query })