react-autocomplete icon indicating copy to clipboard operation
react-autocomplete copied to clipboard

Enhancement: "renderItem" should get an extra parameter which is the current value of the input field

Open CroniD opened this issue 8 years ago • 2 comments

Hi there,

currently it isn't possible to render an item, so that the matching part is highlighted (e.g. bold formatted). The function of the "renderItem" param needs an additional parameter for the current value of the input field. See Autocomplete.js line 276.

CroniD avatar Dec 09 '16 14:12 CroniD

currently it isn't possible to render an item, so that the matching part is highlighted (e.g. bold formatted)

You already have the current value, it's the same as props.value.

CMTegner avatar Dec 30 '16 14:12 CMTegner

Hi @CMTegner ,

I'm aware of that. This issue doesn't point to an implementation bug, it's about api consistency. In other function parameters you pass on the current value of the input field, which means these functions are side-effect free (regarding the value), e.g. "shouldItemRender", "sortItems" etc. This one is not.

CroniD avatar Jan 05 '17 09:01 CroniD