Use AutoComplete as a Select component

@adam

I am thinking of using the auto complete component the same way as a select component for a larger result list (search feature).

The following features are missing for that:

  • see results at the beginning and not only after insert a search text
  • multiselect

Is this possible currently or should I open an GH issue?

Both features are possible but not implemented.

Check out the component here for what is possible: https://material-ui.com/components/autocomplete

Please file GitHub issues for what you’d like to see.

Great :slight_smile:

https://github.com/ironmansoftware/universal-dashboard/issues/1611

1 Like

@adam will this feature be implemented in V3?

I am hoping to see auto-completion / search in UD-InputField Select as I have a large list of items in my drop down menu.

The autocomplete is already in v3 and works in the UDForm. Still need to implement multi-select and an initial value but those will make an appearance in v3 as well.

2 Likes

@adam -

Any ETA for V3 release?

I was wondering, do we need to re-do our UDInput completely (change to UDForm), or can we call New-UDAutocomplete input field under UDinput?

I would assume most of the existing component (V2.9) would still work - correct?

v3 is still a couple of months out. In terms of switching over, for UDForm, you will likely have some adjustment there but one of the final things we do before our v3 release will be providing tooling and\or documentation for migrations. New-UDAutocomplete will not work with New-UDInput.

Many of the v2.9 components will still work (Buttons, textboxes, etc). Some are totally different (UDTable and UDGrid). Custom components will also still work (UDStyle, UDHelmet)

@adam -

Will there be the element New-UDInputField “textarea” in the V3 version? So a way to use the field in the new UDForm?

Yep. You’ll be able to use the New-UDTextbox cmdlet in UDForm to produce a mutli-line textbox. Here’s the UI component it’s using: https://material-ui.com/components/text-fields/#multiline

Very nice :slight_smile:

@adam

Has this been included? I can’t seem to find parameter for multiselect for UDAutocomplete.

The UDselect is not in full-width, and its ugly.

image

There isn’t a mutliselect for autocomplete. You can stretch the select with the -MaxWidth parameter. Try setting it to 100%.

EDIT: I just realized that -MaxWidth is not yet released so you will have to wait until version 1.5.17 for the functionality.

Thanks for the update.

I sure hope you’d release autocomplete with multiselect too - its a hassle for the user to search and add one by one for now.

I’ve added multiselect. It will be in 1.5.17

Yay!! Thanks alot, adam! :slight_smile:

@adam

Thank you for the multiselect in Autocomplete - I can see the data in body.

{
    "context": {
        "userInput": "xxxxxx",
        "organization": AT",
        "position": [
            "value1",
            "value2",
            "value3"
        ]
    }
}

However, how do we access the eventdata in UDstepper? Just need to ensure when user press back button, the data previously entered data is selected.

UPDATE:
So what I figured, the $eventdata.context.position is there. But when I put it in the value, press the back button, the value is returned in one string - if a user select one value its fine. If a user selected multiple value, everything will be in one string. This is probably the autocomplete script parameter which only accept [string] value instead of array.

Updated the [string]$Value to [string[]]$Value fixed the problem. :slight_smile:

Glad you found a work around but I think this should be easier. I’ll open an issue to try and resolve this internally.