Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 1
    I tried giving the path also, but this did not stop scrolling to the top of the page, I have edited the question with router options also, may be there is some change needed there. Commented Nov 3, 2016 at 6:10
  • Is your query param intended to scroll to the right place in the document? Like your other question on anchor tags? Commented Nov 3, 2016 at 6:57
  • 1
    No, I just want to add the query param in URL, I don't want any scroll here. Commented Nov 3, 2016 at 7:31
  • 1
    so I am on the same page, when I select some input, I want to add them in the URL, but when I do it, scroll happens. Scroll is the issue for me. I am not trying to navigate to other page, I just want to be on same page and add/modify url query params seemlessly. Commented Nov 3, 2016 at 10:56
  • 1
    Here is an old discussion on this topic. The only way to change query params is to use $router.push or $router.replace, which navigates to the same route again. Now the component is refreshed and it scrolls back to top. If you are trying to do infinite-scroll or equivalent, your only option is to identify the query params, process it and scroll to the relevant section in the bottom somehow. Based on my current knowledge, I don't think you can change query params while remaining in the same route. Maybe we can wait for a different answer. Commented Nov 3, 2016 at 11:36