react-autocomplete
react-autocomplete copied to clipboard
Enhancement: "renderItem" should get an extra parameter which is the current value of the input field
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.
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
.
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.