-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat(component): Add chip component #189
Conversation
(cherry picked from commit de4c480fb1dee5a6170dde3bde832fd3a5f9844d)
Hey @animesh1987 👋 pushed a commit with a couple of changes mainly:
|
></StyledCloseButton> | ||
); | ||
|
||
return ( |
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.
Do we even want to render the chip if there is no label
?
return ( | |
return label ? ( |
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.
If we add the above, you should add another test with no children.
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.
I thought about that but I think it's a bit easier to spot if we render a chip which looks wrong than to not render at all. Thoughts?
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.
Just from my own experience experimenting with chips
, I think it's better if we display an empty chip than no chip at all. I was able to debug I wasn't sending the right text immediately.
|
||
{renderDeleteButton()} | ||
</StyledChip> | ||
); |
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.
Addition from above.
); | |
) : null; |
export const StyledChip = styled(Box)` | ||
align-items: center; | ||
display: inline-flex; | ||
user-select: none; |
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.
🍹Is there a specific reason why we wouldn't want people to select the text?
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.
Not really, it just looks terrible and doesn't seem that useful 🤔
></StyledCloseButton> | ||
); | ||
|
||
return ( |
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.
Just from my own experience experimenting with chips
, I think it's better if we display an empty chip than no chip at all. I was able to debug I wasn't sending the right text immediately.
Thanks for pushing it through @deini 👍 |
What
Testing
@jorgemoya