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

Display message to the user if an empty search is performed #37

Closed
JasonFritsche opened this issue Mar 7, 2019 · 9 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@JasonFritsche
Copy link
Owner

Currently, if nothing is entered in the search input, and the user presses enter or clicks the button to search, a search is not performed. This behavior is fine. However, a message should be displayed that tells the user that the search bar cannot be empty.

This can be a modal that pops up, or a paragraph or heading tag that is hidden, and then is displayed for maybe 3 or seconds. The message should say something like "Search cannot be empty" or "Please enter a search term", or something similar.

@JasonFritsche JasonFritsche added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 7, 2019
@cdrani
Copy link
Collaborator

cdrani commented Mar 7, 2019

Why is this necessary at all? Why not just disable the the search button if the input is empty. Additionally also cancelling the form submission if user presses enter key on an empty input.

@JasonFritsche
Copy link
Owner Author

This is just an elegant way of handling an empty search. It would be fine without it, but why not show a brief message. It doesn't have to be a modal, a paragraph tag that is shown for a brief period of time would be fine.

@ghost
Copy link

ghost commented Mar 24, 2019

Does this issue still require help? I'd be glad to take it. Thanks !

@JasonFritsche
Copy link
Owner Author

JasonFritsche commented Mar 24, 2019 via email

@ghost
Copy link

ghost commented Mar 24, 2019

I've implemented a preliminary on my branch, here is a giphy recording: modal on empty search bar, please let me know if you can see the recording, thank you !

@ghost
Copy link

ghost commented Mar 24, 2019

i'm not sure how the overall project will react, but i've added modal from bootstrap. meaning, i had to add bootstrap based on the documentation from Modal API - React-Bootstrap, in specific, the documentation points towards adding the dependency. on my local machine this was a quick fix,

Steps:
Terminal > Project Directory (inside Brewery Finder) > *CMD
*CMD => npm install react-bootstrap bootstrap according to install react-bootstrap

import Modal from 'react-bootstrap/Modal'

@cdrani
Copy link
Collaborator

cdrani commented Mar 26, 2019

@PabloRosas17: When you get the chance can you take a look at #42 code review?

@bonbon12
Copy link
Contributor

bonbon12 commented Apr 3, 2019

Hi, what about using tool tips to display the "empty search" message.
I'm thinking of a few different ways:
->Either when they click on the search bar it displays

image

->Rendering it in after an empty search

Let me know what you guys think

@JasonFritsche
Copy link
Owner Author

@bonbon12 I don't think a tooltip is appropriate for this issue.

@cdrani cdrani closed this as completed in #57 Apr 8, 2019
cdrani added a commit that referenced this issue Apr 8, 2019
* implement alert box for empty search

* Add in react-bootstrap Alert component to display flash for 2
seconds with user-friendly message stating search input is
required.

* update setTimeout to 1500ms

Closes #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants