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

fix autocomplete url params #690

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

fruityperson
Copy link
Contributor

Replaced ?&input with ?input in autocomplete request url, this should fix filtering by type #686.

P.S. This is my first contribution to open source, please let me know if I did something wrong.

replaced ?&input with ?input, this should fix filtering by type FaridSafi#686
@bell-steven
Copy link
Collaborator

bell-steven commented Feb 12, 2021

Good catch, and thank you for the PR!

My testing shows that this does not resolve #686, but it might still be worth merging this PR.

I always thought that adding an & before the first query param made no difference.

I would like to get some more clarity on the issue that you are having, which is different than the issue #686 was created for.

@fruityperson
Copy link
Contributor Author

Hello, sorry for late response, had a busy week.

I haven't tested the issue @tgreco has in #686, however this should fix many potential filtering errors as it seems that Google has problems parsing ?& in params.

Although I described the issue in #686, I will describe my steps to give more clarity:

  1. I added types param to query (along with other params as key, ...)
query={{
        types: "address",
      }}
  1. Filtering by type didn't work - results included cities, countries, businesses, etc.
  2. I analysed the source code and found ?& in request query
  3. Removing the & solved my issue and search results were properly filtered (included only type "address")

According to Wikipedia, query params should look like that: https://example.com/path/to/page?name=ferret&color=purple (note ? before first param, & before other params)

multiple query parameters are separated by the ampersand, "&"

Source

@bell-steven bell-steven merged commit 994affc into FaridSafi:master Mar 23, 2021
@bell-steven
Copy link
Collaborator

Sorry for the delay in getting this out.
Released as v2.3.0

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

Successfully merging this pull request may close these issues.

2 participants