Skip to content

Commit

Permalink
Make search input take focus on location selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Dec 12, 2024
1 parent 14ef03a commit 936d7f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/SearchLocation.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<script lang="ts" setup>
import { NInput } from 'naive-ui';
import { nextTick, onMounted, ref } from 'vue';
import useSocksProxies from '@/composables/useSocksProxies/useSocksProxies';
const { query } = useSocksProxies();
const inputRef = ref<HTMLInputElement | null>(null);
onMounted(async () => {
await nextTick();
inputRef.value?.focus();
});
</script>

<template>
<NInput v-model:value="query" placeholder="Search" clearable class="mb-3" />
<NInput ref="inputRef" v-model:value="query" placeholder="Search" clearable class="mb-3" />
</template>

0 comments on commit 936d7f0

Please sign in to comment.