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

navigate! appends query when using html5 #15

Closed
theasp opened this issue Dec 13, 2017 · 8 comments
Closed

navigate! appends query when using html5 #15

theasp opened this issue Dec 13, 2017 · 8 comments
Labels

Comments

@theasp
Copy link

theasp commented Dec 13, 2017

When using :html5? true, the query gets appended to the the URL in the browser when using navigate!. The following generates a url ending with ?show-fields=true?show-fields=false?show-fields=true?show-fields=false?show-fields=true after toggling a few times. With :html5? false it works as expected.

(defn navigate! [view params query] 
  (debugf "Navigating to: %s" {:view view :params params :query query})
  (bide/navigate! router view params query))

(defn toggle-fields-visible! [{:keys [name params query]}]
  (navigate! name params (update query :show-fields #(if (= "true" %) "false" "true"))))

The output is:

DEBUG [xxx.core:31] - Navigating to: {:view :xxx/query-table, :params {:table-name "log"}, :query {:show-fields "false"}}

Nice library!

@niwinz niwinz added the bug label Dec 13, 2017
@gmp26
Copy link

gmp26 commented May 25, 2018

Does anybody have a fix for this yet? Or should we fork and investigate?

@niwinz
Copy link
Member

niwinz commented May 25, 2018

I havent see the isue on my projects, and i didnt have time, but if you have time plase submit a PR with a fix :D

@gmp26
Copy link

gmp26 commented May 26, 2018

Good to know that. It's possible the issue appears if the necessary server redirect isn't yet in place. We'll see shortly!

@theasp
Copy link
Author

theasp commented Jun 10, 2018

I think this might actually be fixed, I just tried :html5 true and it seems to work fine.

@gmp26
Copy link

gmp26 commented Jun 11, 2018 via email

@theasp
Copy link
Author

theasp commented Jun 16, 2018

I was wrong, it's still broken for me :(

@kennyjwilli
Copy link
Contributor

If you have :html5? true set, you will get the problem. Setting :html5 (without the ?) does not use the html5 history. This is definitely a bug.

@benzap
Copy link

benzap commented Mar 23, 2020

I'm still seeing this issue. I'll look into creating a fix PR

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

No branches or pull requests

5 participants