feat(SelectMenu): allow creating option despite search (#1080)

* chore: initial

* chore: use reusable vnode

* fix: use component with vnode

* chore: option placement

* chore: finish

* up

* up

* up

* fix(selectmenu): non-object custom options

* up

---------

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Inesh Bose
2023-12-15 14:04:06 +00:00
committed by GitHub
parent 23770d8cf0
commit 0fdc8f70b6
5 changed files with 96 additions and 8 deletions

View File

@@ -117,6 +117,8 @@ componentProps:
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.
You can also configure this globally through the `ui.selectMenu.default.clearSearchOnClose` config. Defaults to `false`.
::component-card
---
baseProps:
@@ -158,6 +160,20 @@ componentProps:
---
::
However, if you want to create options despite search query (apart from exact match), you can set the `show-create-option-when` prop to `'always'`.
You can also configure this globally through the `ui.selectMenu.default.showCreateOptionWhen` config. Defaults to `empty`.
Try to search for something that exists in the example below, but not an exact match.
::component-example
---
component: 'select-menu-example-creatable-always'
componentProps:
class: 'w-full lg:w-48'
---
::
## Popper
Use the `popper` prop to customize the popper instance.