-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Dropdown without jQuery #226
Conversation
<input type='checkbox' value={search} onChange={this.toggleSearch} /> | ||
{' '}Search | ||
</label> | ||
</p> |
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.
The docs are getting an overhaul to better demonstrate the v1.0 component APIs. Take this example with a grain of salt. It is here only to show that the Dropdown works as expected.
b79e1f7
to
27044f4
Compare
27044f4
to
7ebc558
Compare
|
||
static defaultProps = { | ||
icon: 'dropdown', | ||
// TODO 'searchInMenu' or 'search='in menu' or ??? How to handle this markup and functionality? |
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 confirming we want this TODO in here.
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.
aye, thanks. this is a reminder to handle the search in menu dropdown.
Lots of code in here, but I passed over and nothing other than the required |
7ebc558
to
645cd6e
Compare
Hey...
This is an interim PR. There are todos, comments, missing features, and ugly things. There shouldn't be any bugs or cruft, though.
The rewrite thus far is >600 lines in the Dropdown and >700 lines in Dropdown tests. I want to get some eyes and feedback on the functionality and approach thus far before cleaning up and abstracting things.
The
multiple
feature will be added in the next Dropdown PR.Areas of concern
These are the areas to watch and comment on. These are some known ugly parts. They've been added as TODOs to the main PR #206.
Events
We have two event systems at play, React synthetic events and real DOM events. You'll see lots of
document.add/removeEventListener
calls. This is necessary for keyboard and mouse events that are dispatched on the document. Example, clicking outside the dropdown or pressing escape to close an open dropdown. Ideally, we'll write a clean abstraction for handling these. Considering that we need to:Debug / Logging
Currently, nearly every method has a
console.debug()
when called and aconsole.log()
for any relevant debugging data. This would be pulled into an actual debug util. Consider:Spreading Consumer Props
Stardust components should spread the consumer's props. We've experimented with a couple patterns for doing this effectively, though they each beak down. Consider:
...props
inrender()
isn't sufficient when breaking down many render methodsIf it weren't for stripping propTypes in production we may be able to naively: