-
Notifications
You must be signed in to change notification settings - Fork 13
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(chip): add / modify chip component #181
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.
Looks like the setState
method doesnt have coverage around it, I would just delete it unless you think we need it for something
Should probably add keyboard navigation (make sure focus states work and ability to toggle with space bar) |
import html from 'nanohtml'; | ||
import Chip from '../../src/components/chip'; | ||
|
||
function triggerEvent(el, type) { |
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.
cant remember if this is used elsewhere but we maaaay want to abstract into a util, definitely not blocking on this
@adamraider added keyboard nav support! thanks for catching that |
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.
AMAZING
} | ||
|
||
_bindEventListeners() { | ||
this._root.addEventListener('mousedown', this.onClick); |
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.
this came up for another component I can't quite remember, but should we add this for touchstart
as well? Did you test on your phone?
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.
great catch! it looks like both the touch
events and click
events retain hover styling when clicking on mobile. so i added the hover style to non mobile screens only.
here's a lil demo https://cl.ly/16bf6c68733d
</div> | ||
</div> | ||
); | ||
}); | ||
storiesOf('Chip', module).add('micro', () => { |
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.
nit: you can chain these .add statements
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.
niiiiiiiice
A continuation of #10 that adds icon support for chips
https://cl.ly/554d75534195