Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

navigate() does not keep queryparameter even with fourth argument set to false #157

Open
alex-frx opened this issue Apr 18, 2021 · 3 comments

Comments

@alex-frx
Copy link

alex-frx commented Apr 18, 2021

navigate("/authentication?test=true",false,{a:false},false);
only ?a=false will be appended

@khushal87
Copy link

Hey, @alex-frx I am navigating using navigate api. The URL is changing but the page is not heading to a new page. Why is it happening?

@alex-frx
Copy link
Author

alex-frx commented Apr 24, 2021

@khushal87 im not associated with the project but maybe i can help. open a new issues that is related to your question and include your component that redirects and your routes

@Ueland
Copy link

Ueland commented Jul 23, 2021

This issue is also relevant for the use of the A element in this package.

I suspect that the call to navigate in

navigate(e.currentTarget.href);
should be changed into something like this:

    let params = {}
    if(e.currentTarget.href.indexOf("?")>-1) {
        params = Object.fromEntries(new URLSearchParams(e.currentTarget.href.split( "?")[1]))
    }
    navigate(e.currentTarget.href, false, params, false)`

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

No branches or pull requests

3 participants