feat(SelectMenu): allows to clear search query on close (#968)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Italo
2023-11-21 14:59:42 -03:00
committed by GitHub
parent ceb2ed36d4
commit 11ccbbb24e
3 changed files with 31 additions and 1 deletions

View File

@@ -99,6 +99,23 @@ props:
---
::
#### Clear on close :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"}
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
---
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:
clearSearchOnClose: 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.