-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fixes #1983: Improve SearchHelp logic #2163
Conversation
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.
Found a minor bug (though I think this was pointed out during our meeting today) where the search help is not shown if a you search for nothing, after searching for something.
You can see it occur in this video:
https://user-images.githubusercontent.com/7242003/115086271-edd23400-9ed9-11eb-98ff-d38fb53dcc16.mp4
Not sure if this is related to your PR or not. Looks great otherwise though!
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.
Except the one Chris mentioned, all look great! This search help logic makes more sense.
// If there is no posts or if the search bar is empty, then show the search help, otherwise hide it
if (!error && (isEmpty || textParam.length == 0)) {
toggleHelp(true);
} else {
toggleHelp(false);
} So I noticed in your demo that it returned a server error; how I have it right now is that if there is an error we don't display the |
Weird. If the bug isn't coming from your PR then yeah I think the current behaviour is fine and it should not show the search help. Could you file an issue for it? PS Let me know when you rebase it and I can approve it 😄 |
@yuanLeeMidori @chrispinkney rebased |
Issue This PR Addresses
Fixes #1983
Type of Change
Description
Previously, as soon as you hit the submit button the SearchHelp would disappear. The only way to get the SearchHelp to appear again would be to refresh the page.
It would be beneficial if the SearchHelp would appear when the User's search returned no results (case A) or if the search bar was empty (case B).
This is better logically speaking since in those two additional scenarios we can assume that the User either failed their search or are about to search for something, both of which would benefit from seeing the SearchHelp. That is what this PR accomplishes.
Read more here
How to Test
validation.js
(it should return a timeline of posts)SearchHelp
component truly disappeared (it should be hidden)fasdfsadf
(it should returnNo Results Found
)SearchHelp
component should be visibleSearchHelp
component should be visibleChecklist