Bootstrap-3-Typeahead
Bootstrap-3-Typeahead copied to clipboard
highlighter is called with item’s name as the argument, but the documentation says it receives an item
The documentation says highlighter
accepts item
as its parameter, but when I try to check e.g. item.id
, it returns undefined
. It seems that the parameter is actually not the item, but the item’s name. (I think) I understand how it actually works, but the wording in the documentation is confusing.
I guess this issue is solved in version 4.0.2 due to the render
function calls your custom highlighter
like this:
highlighter(text, item)
Just use the second argument.