Skip to content

Commit cb160e6

Browse files
committed
fix(InputMenu): reset search term on mounted
Resolves #3993
1 parent 4d4234d commit cb160e6

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

‎src/runtime/components/InputMenu.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export interface InputMenuSlots<
171171
</script>
172172

173173
<script setup lang="ts" generic="T extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false">
174-
import { computed, ref, toRef, onMounted, toRaw } from 'vue'
174+
import { computed, ref, toRef, onMounted, toRaw, nextTick } from 'vue'
175175
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from 'reka-ui'
176176
import { defu } from 'defu'
177177
import { isEqual } from 'ohash/utils'
@@ -301,6 +301,10 @@ function autoFocus() {
301301
}
302302
303303
onMounted(() => {
304+
nextTick(() => {
305+
searchTerm.value = ''
306+
})
307+
304308
setTimeout(() => {
305309
autoFocus()
306310
}, props.autofocusDelay)

0 commit comments

Comments
 (0)