Skip to content

Commit c5630a7

Browse files
author
yaroslav8765
committed
chore: use nextTick insted of setTimeout in Select.vue
1 parent a2c0ac3 commit c5630a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adminforth/spa/src/afcl/Select.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
</template>
111111

112112
<script setup lang="ts">
113-
import { ref, computed, onMounted, onUnmounted, watch, type Ref } from 'vue';
113+
import { ref, computed, onMounted, onUnmounted, watch, nextTick, type Ref } from 'vue';
114114
import { IconCaretDownSolid } from '@iconify-prerendered/vue-flowbite';
115115
import { useElementSize } from '@vueuse/core'
116116
@@ -175,10 +175,7 @@ function updateFromProps() {
175175
}
176176
}
177177
178-
function inputClick() {
179-
setTimeout(() => {
180-
handleScroll();
181-
}, 0);
178+
async function inputClick() {
182179
183180
if (props.readonly) return;
184181
// Toggle local dropdown
@@ -187,6 +184,9 @@ function inputClick() {
187184
if (!showDropdown.value && !search.value) {
188185
search.value = '';
189186
}
187+
188+
await nextTick();
189+
handleScroll();
190190
}
191191
192192
watch(

0 commit comments

Comments
 (0)