-
Notifications
You must be signed in to change notification settings - Fork 63
Create the InputField
and SearchBar
components
#380
Conversation
InputField
and SearchBar
components
…n input and button
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.
These look beautiful. Spot on to the figma designs. A couple of functionality notes:
- really like that the
extraText
is "dumb"—the parent can handle what this displays 👍 - I don't seem to be able to add a submit event listener to the
<SearchBar />
- Just noting that the search input will become a
combobox
at some point to show the user their recent searches
@zackkrida thanks for the heads-up about the combobox. Do we need to do something at the moment to prepare for this change? I've changed the way the submit event works. Now it should be possible to directly attach to the |
I'm also looking for ways to unify the |
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.
These look and work amazing!
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.
Some tiny things I've noticed after looking more closely:
- The SearchBar's search button is rounded on the right in Figma, but not rounded in Storybook.
- In Figma, when the Search Input is focused, only the Search Input's border becomes pink, the border of the Search Button stays gray. When the Search Button is focused, on the other hand, the Search Button's border becomes pink, and the Search Input's border is gray. And in both states the input background is still white.
- If I understand correctly, only when we have a combobox, and when it is open and shows selections, is when the input background becomes gray, and the Search Button becomes pink. Am I right, @panchovm ?
You are right @obulat when it is a combo box, both elements react differently as separated. |
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.
LGTM after the small remaining fixes from @obulat. Great work!
The button is actually rounded on the 'end' side, it's a bug with the Tailwind RTL plugin (fix merged) that prevents it from showing. Changing the direction to RTL and then back to LTR whould reveal the rounded corners in Storybook, but be2b67f provides a workaround for this. |
@obulat what you say about focused states in point#2 is already true. They behave in the same manner as you mentioned: When you say 'focused', do you mean 'hovered'? Because if so, @panchovm mentioned in point#2 of his comment that the during |
Thank you for detailed explanations with all the links, @dhruvkb ! |
No worries at all @obulat. I would try to explain it in two examples Search navigated by keyboardWhen the keyboard navigates, the first focused element is the search input, and then the search button. The style for both is Search activatedWhen the user clicks on the search input to search for something, search input and search button change to |
One more quick question, @panchovm : What happens if the user simply hovers over the input, without focusing it or activating it? |
I'm also confused by the Screen.Recording.2021-11-11.at.5.09.28.PM.mov |
@obulat @dhruvkb search.bar.all.states.mp4My understanding about Please correct me if I misunderstand it. |
I'm still having a bit of a hard time to understand so help me please. Let's not use the context dependent word 'active' for some time. Let's use the words 'hover', 'focus' and 'opened'/'closed' for the suggestion box. With this vocabulary, so far I have this: [1] State [2] State [4] State Also based on my understanding, the suggestion box will appear for states [2] and [4]. The presence of absence of the suggestion box will not affect the appearance of neither the input nor the button. |
Replying per point: (1): Yes. Let me stop here. For points 4 and 5, I think we're understanding (4): Yes And your sentence about recent searches box is correct. |
@panchovm thanks! I think I understood your meaning a little more clearly now. I implemented
Let me know if you think these changes match your vision of the component's behaviour. |
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.
Fixes
Fixes #374 by @dhruvkb
Fixes #375 by @dhruvkb
Description
This PR creates an input field component and search field component.
Testing Instructions
npm run storybook
.http://localhost:6006/
.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin