yury-dymov / react-autocomplete-input

Autocomplete input field for React
https://yury-dymov.github.io/react-autocomplete-input/
MIT License
199 stars 65 forks source link

Allow rendering options with custom component #45

Open CodyReichert opened 4 years ago

CodyReichert commented 4 years ago

Hey there great library! Are there any plans to allow rendering the items in the options list with custom components? Or would a PR be accepted?

For example:

<ReactAutocompleteInput
  options={["apple", "banana"]}
  renderOption={opt => <Component>{opt}</Component>}
/>
yury-dymov commented 4 years ago

Hi Cody, I am not actively supporting it but I will gladly review and merge good PR

imbedhead commented 1 year ago

96 Lil late to the party, but had the same need as OP and created a PR for it. Love the library, hopefully someone else can use my change as well!

lyleaigbedion commented 1 year ago

@yury-dymov ^

yury-dymov commented 1 year ago

Done, sorry for the wait. Unless I misunderstood code changes, we would have to change 52 constant to dynamic item height evaluation for the option item elements and it would be good to go