-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix: support links with only query parameters #80
base: main
Are you sure you want to change the base?
Conversation
@jounimakela thanks for opening this issue. I think the problem isn't with I think if we want to fix that here, we should fix it for all links and not just for when we do a You can see that here: phoenix_test/lib/phoenix_test.ex Lines 214 to 215 in e1a2408
I'm open to the idea of us handling it here (in |
I think this is also related to #72 (though probably need different fixes). Just noting that here. |
@jounimakela any thoughts on my comment from before? (#80 (comment)) |
Apologies for my delayed response.
Sounds good! I'll make a proposal for a fix and open an issue. |
Thank you! 🎉 And no apologies needed. This is open source, so we all work on it when we can. 😄 Just wanted to check if this was still something you wanted to fix, and was doing my due diligence here. |
This commit resolves an issue where links containing only query parameters without a specified path would incorrectly direct to the root path instead of the current path, unlike standard browser behavior. Example of a link without a path: <a href="?lang=en">English</a> Previously, `click_link/2` would direct to root path. In this commit the link correctly retains the current page while applying the query parameters.
Fixing the path is now in I'll also squash commits once we are happy with the changes. Thoughts? |
Thanks for making the change!
Yeah, I agree. Something about it doesn't feel great. I think it's because if feels like a band-aid (which it is) on something that Were you able to open the issue on the |
Open now! phoenixframework/phoenix#5877 |
@germsvel looks like |
This commit resolves an issue where links containing only query parameters without a specified path would incorrectly direct to the root path instead of the current path, unlike standard browser behavior.
Example of a link without a path:
Previously,
click_link/2
would direct to root path. In this commit the link correctly retains the current page while applying the query parameters.