patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

[feat] pfe-autocomplete | Doesn't work with list of objects, only with strings

Open maboye opened this issue 6 years ago • 3 comments

It would be great to make this component more flexible to use by allowing it to accept functions for:

  • manipulating how data is displayed in the dropdown (i.e. accept list of objects and for each object, concatenate some values to output string).

  • determine what value to return when an item is selected from the dropdown. [ We don't always want what is displayed in the dropdown to the user to be returned. ]

maboye avatar Jul 17 '19 19:07 maboye

Hey @maboye - We'll take a look at this and see what we can do. I hope to get back to you real soon.

kylebuch8 avatar Jul 25 '19 14:07 kylebuch8

@maboye - Can we work from this Codesandbox? https://codesandbox.io/embed/compassionate-solomon-cdb48

I've set up a quick example that should help us identify the issue. I think my example demonstrates how to do what you want in the first bullet point. For the second bullet point, I think we need to make a code change to identify the index of the object in the array.

kylebuch8 avatar Jul 25 '19 14:07 kylebuch8

Is this still relevant with @patternfly/pfe-autocomplete@^2.0.0-next.0?

bennypowers avatar Feb 23 '22 22:02 bennypowers