Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On focus is triggering another search #47

Closed
tsuharesu opened this issue Feb 19, 2019 · 2 comments
Closed

On focus is triggering another search #47

tsuharesu opened this issue Feb 19, 2019 · 2 comments

Comments

@tsuharesu
Copy link

Every time I click on the TypeAheadField, even if I don't type anything, suggestionsCallback is being triggered. I looked into _SuggestionsListState but couldn't figure out why if (widget.controller.text == this._lastTextValue) return; this is not working.

Right now I have to create some kind of check inside suggestionsCallback to return an empty list instead of hitting the API.

@sjmcdowall
Copy link
Collaborator

I have that same code in all my usages too -- something like:

      suggestionsCallback: (String pattern) async {
        // logger.fine('suggestionsCallback() - $pattern');
        if (pattern == _oldPattern) {
          return _recipients;
        }

        // New search string..go get the results..
        _oldPattern = pattern;

I didnb't even know we were trying to check it .. :)

@sjmcdowall
Copy link
Collaborator

Solved in 1.0.5 .. closing..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants