-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Proposed fix for Kudos marketplace search bar #5376
Conversation
When you add whitespace in search bar value, for example: "Limited edition", the query parameters will be "Limited+edition", so when results come back in the view, the search bar get its value from query parameters (queryParam.q), so it will also show up in the search bar as Limited+edition. The simplest solution is to replace the plus signs with whitespace, i think it does look better.
@ososco nice! Thanks for the PR! In the PR description, theres a section to add how you tested your changes - here a screenshot or video would be good, or just a brief description on how you verified the changes are working. Thanks again! |
Actually there is a better way to fix this with decodeURIComponent, i will commit the new fix after testing it. |
Remove plus sign "+" in URL query string by decoding the query using "decodeURIComponent", and replace plug sign with "%20" before the decode in case the plug sign is part of the search query, such in "C++"
Codecov Report
@@ Coverage Diff @@
## master #5376 +/- ##
==========================================
+ Coverage 29.67% 32.23% +2.55%
==========================================
Files 242 244 +2
Lines 20601 25532 +4931
Branches 2968 4348 +1380
==========================================
+ Hits 6114 8231 +2117
- Misses 14236 16898 +2662
- Partials 251 403 +152
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks great!
@ososco I changed the base branch to be 'master' |
⚡️ A tip worth 0.20000 ETH (38.05 USD @ $190.27/ETH) has been granted to @ososco for this issue from @owocki. ⚡️ Nice work @ososco! Your tip has automatically been deposited in the ETH address we have on file.
|
|
Description
When you add whitespace in search bar value, for example: "Limited edition", the query parameters will be "Limited+edition", so when results come back in the view, the search bar get its value from query parameters (queryParam.q), so it will also show up in the search bar as Limited+edition. The simplest solution is to replace the plus signs with whitespace:\
$('#kudos-search').val(queryParam.q.replace(/+/g, " "));
I think it does look better.
Refers/Fixes
Testing