Open Klinton90 opened 7 years ago
Same problem here...
I'm looking for a work around in the meanwhile.
I have changed the getMatchesAsync function, that was the easiest way that I have found to make it work.
if (showHint) {
if (scope.matches.length > 0)
{
var firstLabel = scope.matches[0].label;
if (angular.isString(inputValue) &&
inputValue.length > 0 &&
firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {
hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));
} else {
hintInputElem.val('');
}
}
}
Bug description:
When using
typeahead
with attributestypeahead-select-on-exact="true"
andtypeahead-show-hint="true"
exception is thrown when exact match happens:Cannot read property 'label' of undefined
Link to minimally-working plunker that reproduces the issue:
https://plnkr.co/edit/HrKQIcOy0XjN9BBosdRS?p=preview
Steps to reproduce the issue:
1) Open DevTools 2) Type "Alabama" in input field 3) Error appears in log.