CodeBeam.MudBlazor.Extensions icon indicating copy to clipboard operation
CodeBeam.MudBlazor.Extensions copied to clipboard

SelectExtended / ComboBox: Adding new items to the box from the search field

Open seyfeb opened this issue 1 year ago • 2 comments
trafficstars

I may be missing something but is there a way to use the MudComboBox to dynamically add values that are not yet available for selection?

The use use would be a list of tags that is prefilled with existing tags but allows for adding text by typing, e.g., in the search box and hitting enter to confirm the new tag.

I can't see a way to get the keydown event in the search field and extract the search value to add it to the list of available items.

Edit: I found that on that for the MudSelectExtended component you can store a local copy of the search string by subscribing to the OnSearchStringChange event. However, I still do not see a possibility to, e.g., track the 'KeyUp' event in the search box to check if Enter was pressed with an unknown value.

seyfeb avatar Aug 06 '24 10:08 seyfeb

For reference: I'm looking for something like this ComboBox https://vuetifyjs.com/en/components/combobox/#multiple-combobox where you can type some unknown value and on tab or enter the types value is used.

seyfeb avatar Aug 07 '24 19:08 seyfeb

It might be also possible to use MudChipField but this is missing the autocompletion functionality.

seyfeb avatar Aug 13 '24 13:08 seyfeb