corejavascript / corejavascript/typeahead.js

AsyncRequest event missing argument ... when it should not be fired at all

Open
#68 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
968
Forks
231
PR merge metrics
No merged PRs in 30d

Description

I am trying to set the value of a text field that is being used as typeahead. Because I don't want to trigger a query from Bloodhound, I'm using this line

```
element.data('ttTypeahead').input.setQuery(newValue, true);
```

However, Bloodhound is _still_ trying to fetch some data, even though the `silent` option is being passed. In fact, `typeahead:asyncrequest` is still being fired, but with a single argument. I tried debugging, and it seems that the event is [being called](https://github.com/corejavascript/typeahead.js/blob/5c49ed8014459a7819e58ef5648eae97a24c0fb8/dist/typeahead.bundle.js#L2030) with `dataset = undefined`, which cause this behavior.

The point is, how to set the value of the input field without triggering the suggestion menu to open, or even Bloodhound from performing an async request?

All and all, there is a problem at the moment and things are not working as expected.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.