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

Predictions don't close #13

Open
sentd94 opened this issue Nov 29, 2021 · 3 comments
Open

Predictions don't close #13

sentd94 opened this issue Nov 29, 2021 · 3 comments

Comments

@sentd94
Copy link

sentd94 commented Nov 29, 2021

When selecting a prediction, the prediction text is put into the text field. This might trigger a text change and therefore another prediction search with just 1 result matching the result from the first search.

@AbdulrhmanBazrto
Copy link

same happen here, did you find a solution for this?

@paulobiero
Copy link

paulobiero commented Feb 1, 2023

I resolved this by making sure the text that is on the TextFormField should not be any of the suggested locations
Just edit the google_places_flutter from dependancy level and edit line 100 from

alPredictions.addAll(subscriptionResponse.predictions!);

to

subscriptionResponse.predictions!.removeWhere((element)=> element.description==text);
alPredictions.addAll(subscriptionResponse.predictions!);

This will solve this problem

@hanif-simform
Copy link

hanif-simform commented Sep 1, 2023

The thing is overlay is not removed if latlong fetch is not enabled, so here change is needed:

https://github.com/Shrutimahajan/Google-AutoComplete-TextField-Flutter/blob/4bfdeaa92eb430dbc4b944b0b0992797bcc919dc/lib/google_places_flutter.dart#L148C32-L153C49

if (!widget.isLatLngRequired){
 removeOverlay(); // added 
 return;
}

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

4 participants