-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
When query value starts with #, router doesn't recognize it #804
Comments
In fact it seems that replacing This also fixed subtle breakage caused by entering something like |
Another failing case: if I call |
My proposed fix is #805 along with previously failing tests. |
Actually all I did to get it working was removing When @mjackson is back, I hope he can shine some light on why he added it. |
Previously, special characters in query were left as is, potentially overwriting other query parameters and causing ambiguity. Now, they are properly escaped. Fixes remix-run#804.
@gaearon I'm looking at this right now. Time to get rid of this bug :) |
I'm doing
this.replaceWith('search', {}, { q: '#test2' })
. In this caseq
is just a string user types into an input field. It's a search field, and user may want to find something by a hashtag.In this case router will simply ignore this query parameter as if it never was there. I'd expect it to be encoded and correctly returned in
state.query
later.qs.stringify
encodes it, butdecodeURIComponent
decodes it back and so it is passed verbatim to the location that assumes it's a hash.Should we just manually encode
#
in a query? cc @mjackson who knows that logicThe text was updated successfully, but these errors were encountered: