Skip to content

Commit

Permalink
fix: Autocomplete search in Link component
Browse files Browse the repository at this point in the history
(cherry picked from commit 6d7078d)
  • Loading branch information
fadilsid authored and mergify[bot] committed Aug 28, 2024
1 parent 3b20d28 commit 2dea65f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions frontend/src/components/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:options="options.data"
:class="disabled ? 'pointer-events-none' : ''"
:disabled="disabled"
@update:query="handleQueryUpdate"
/>
</template>

Expand Down Expand Up @@ -84,14 +85,10 @@ watch(
{ immediate: true }
)
watch(
() => autocompleteRef.value?.query,
(val) => {
val = val || ""
if (searchText.value === val) return
searchText.value = val
reloadOptions(val)
},
{ immediate: true }
)
const handleQueryUpdate = (newQuery) => {
const val = newQuery || ""
if (searchText.value === val) return
searchText.value = val
reloadOptions(val)
}
</script>

0 comments on commit 2dea65f

Please sign in to comment.