mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 16:00:39 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user