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

Add autocomplete search #233

Draft
wants to merge 2 commits into
base: content
Choose a base branch
from
Draft

Add autocomplete search #233

wants to merge 2 commits into from

Conversation

Joozty
Copy link
Member

@Joozty Joozty commented Aug 25, 2020

No description provided.

@vercel
Copy link

vercel bot commented Aug 25, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oacore/next/qcz0lsn80
✅ Preview: https://next-git-autocompletion.oacore.vercel.app

@Joozty
Copy link
Member Author

Joozty commented Aug 27, 2020

@viktor-yakubiv can you please help me out here? It would be nice if you can review and tell me how it should look like. So I can style it properly (if needed)

@viktor-yakubiv
Copy link
Member

viktor-yakubiv commented Aug 27, 2020

I hope the following guide from the Material Design will be useful for you.

Annotations

It may look hard in the implementation but there is a reasoning behind. Icons visual size is 16x16 pixels when the actual SVG file is 24x24. This is because of visual balancing: if you have a square next to the circle, to make it look visually the same the square should be 16 pixels sized when the circle diameter should be about 20 pixels. Because of combining different shapes, we make icons 24x24 but always add -0.25rem margin.

The button clickable area should be big enough to let mobile users easily touch it, that is why buttons are at least 32 pixels but iconic ones are 40-pixel circles.

I am not saying you have something wrong with spacing because I haven't checked. Here, I wanted to say that the 'clear button' should be a circle 40x40 but the icon should stay where it is.

Copy link
Member

@viktor-yakubiv viktor-yakubiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the visual look overall 👍 However, I have some behavioural remarks:

  • when I type something and unfocus the input, the form is submitted
  • once I pressed on the clear icon after typing, the input became unfocussed and the forms submitted

I did not check the code because I think you are aware of it.

components/search/forms/simple.jsx Outdated Show resolved Hide resolved
@Joozty
Copy link
Member Author

Joozty commented Sep 3, 2020

@viktor-yakubiv Thanks for the image. I think I managed to do it. (I may be one or two pixels off but it should be fine). Can you please have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants