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

Autocomplete does not work correctly when the src url contains an existing query parameter #26522

Closed
JoyceBabu opened this issue Jan 28, 2020 · 3 comments · Fixed by #26589
Closed

Comments

@JoyceBabu
Copy link
Contributor

What's the issue?

The dynamic loading option of the autocomplete plugin is not working, when the src url already containers a query string. For example, If I set the src to 'https://amp.dev/search.json' and the query attribute to q, then the requested url is

https://amp.dev/search.json?q=<my search input>&__amp_source_origin=<origin>

But if I change the src to https://amp.dev/search.json?param=1, then the queried url is

https://amp.dev/search.json?param=1&__amp_source_origin=https%3A%2F%2Fnull.jsbin.com

How do we reproduce the issue?

https://jsbin.com/kemihapuce/edit?html,output

  1. Open Network tab in 'Developer Console'
  2. Type in the input box
  3. Check the url of the ajax requests triggered by autocomplete. The query is not present in the requested url.

What browsers are affected?

All browsers

Which AMP version is affected?

Latest

@caroqliu
Copy link
Contributor

Hi, thanks for filing this issue! This is definitely not desired behavior--I'll work on a fix shortly.

@JoyceBabu
Copy link
Contributor Author

@caroqliu If it is okay, shall I send a PR?

@caroqliu
Copy link
Contributor

caroqliu commented Feb 1, 2020

@JoyceBabu Yes, absolutely! Please feel free to add me as a reviewer. Thanks for contributing. :)

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

Successfully merging a pull request may close this issue.

2 participants