diff --git a/docs/content/3.forms/4.select-menu.md b/docs/content/3.forms/4.select-menu.md index 04b28b7cf8..70a51bb2df 100644 --- a/docs/content/3.forms/4.select-menu.md +++ b/docs/content/3.forms/4.select-menu.md @@ -101,7 +101,7 @@ props: #### Clear on close -The search query is not cleared when the menu is closed. You can clear it by setting `clear-search-on-close` to `true`. +By default, the search query will be kept after the menu is closed. To clear it on close, set the `clear-search-on-close` prop. ::component-card --- @@ -116,23 +116,6 @@ props: --- :: -#### Clear on update - -The search query is not cleared when an option is selected. You can clear it by setting `clear-search-on-update` to `true`. - -::component-card ---- -baseProps: - class: 'w-full lg:w-40' - placeholder: 'Select a person' - searchable: true - searchablePlaceholder: 'Search a person...' - options: ['Wade Cooper', 'Arlene Mccoy', 'Devon Webb', 'Tom Cook', 'Tanya Fox', 'Hellen Schmidt', 'Caroline Schultz', 'Mason Heaney', 'Claudie Smitham', 'Emil Schaefer'] -props: - clearSearchOnUpdate: true ---- -:: - ### Async search Pass a function to the `searchable` prop to customize the search behavior and filter options according to your needs. The function will receive the query as its first argument and should return an array. diff --git a/src/runtime/components/forms/SelectMenu.vue b/src/runtime/components/forms/SelectMenu.vue index 9b2b451018..4a70e1e9f5 100644 --- a/src/runtime/components/forms/SelectMenu.vue +++ b/src/runtime/components/forms/SelectMenu.vue @@ -295,10 +295,6 @@ export default defineComponent({ type: Boolean, default: false }, - clearSearchOnUpdate: { - type: Boolean, - default: false - }, popper: { type: Object as PropType, default: () => ({}) @@ -437,12 +433,6 @@ export default defineComponent({ } } - function clearOnChange () { - if (props.clearSearchOnUpdate) { - query.value = '' - } - } - watch(container, (value) => { if (value) { emit('open') @@ -454,8 +444,6 @@ export default defineComponent({ }) function onUpdate (event: any) { - clearOnChange() - if (query.value && searchInput.value?.$el) { query.value = '' // explicitly set input text because `ComboboxInput` `displayValue` is not reactive