Does anyone have a good example of a combobox in an Editor config panel?

The UIBUILDER uib-element node has a selectable list of element types & this list is getting rather long now. So I would like to give users a combo box so that they can type a few letters to get to the appropriate element selection.

I've been trying to do this manually using the jQuery UI autocomplete but I can't quite hit the right magic spell. So I was wondering if anyone had a good example that I could examine?

Cheers, J.

Hi @TotallyInformation

I'm not sure it fits perfectly to what you need, but there is the built in AutoComplete.
you can maybe validate the input to ensure its a valid value?

https://nodered.org/docs/api/ui/autoComplete/

Screenshot 2023-10-18 at 21.27.53

Hi Marcus, thanks for the response. I looked at that but it is only for input fields. There is an option for TypedInput as well but I can't see a way to combine a drop-down with input text for a proper combobox.

There is an example in the jQuery UI autocomplete docs but I'm failing to get it working inside the Editor. I'm probably missing something obvious which is why I hoped someone would have a working example.

To be clear, I want the dropdown for people who don't know what is available and the autocomplete for people who do.

Does datalist not satisfy your need?

1 Like

Ah, I was maybe too focused on using jQuery UI! :grin:

Thanks Steve, I'll have a look at that.

1 Like

Plus - seems it should play nice with CSS also

1 Like

Hmm, well datalist actually doesn't play very nicely with anything! It is actually pretty limited annoyingly. It looks fairly nasty and has limited styling. :frowning:

Datalist is great if you always start with an empty field. Not so good if you want to prepopulate with a previous selection ( as you have to delete to get the drop-down list back)

Thanks Dave, that would seem to be the final nail in that one.

It is weird, looking at the W3C Aria examples, the combo box examples are ENORMOUS!

Maybe I need to look at other options - all ideas welcome. :slight_smile:

Yeah it is a bit limited.

In the past I've used magicsuggest and another I forget the name of (it did fuzzy searching, drop tree and more)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.