Closed igoralves1 closed 2 years ago
same problem. Did you solve it?
Hi there, the issue is caused by:
var typeaheadjs = self.options.typeaheadjs;
if (!$.isArray(typeaheadjs)) {
typeaheadjs = [null, typeaheadjs];
}
This piece of code is adding a null value at the beginning of the typeaheadjs array. So later in the code the instructions:
typeaheadjs.some(function(dataset, _index) {
if (dataset.name === name) {
index = _index;
return true;
}
return false;
});
are throwing the exception. I didn't explore why the null as first element is needed, so my workaround is:
typeaheadjs.some(function(dataset, _index) {
if (dataset != null && dataset.name === name) {
index = _index;
return true;
}
return false;
});
The
dataset
is returningnull
. Also when I press enter nothing happens.I did not used grunt because it is not working. This is what I have in my
index.php
: