-
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
Support multiple dropdown type #254
Conversation
Current coverage is 85.23%@@ master #254 diff @@
==========================================
Files 62 62
Lines 752 806 +54
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 633 687 +54
Misses 119 119
Partials 0 0
|
b265fc4
to
02e7aa3
Compare
// convert the value to/from an array | ||
const newValue = e.target.checked ? _.compact([value]) : value[0] | ||
this.setState({ multiple: e.target.checked, value: newValue }) | ||
} |
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.
Since this example allows toggling the multiple
prop, we need to convert the value to and from an array corresponding to the dropdown type.
🍂 sqursh enrd rbs tur maestr |
|
||
const _detail = detail || detailLink | ||
const detailComponent = (detailLink || onClickDetail) && 'a' || detail && 'div' | ||
const DetailComponent = (detailLink || onDetailClick) && 'a' || 'div' |
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.
Would be nice to wrap the latter check in ()
for similar clarity to the initial expression.
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 seeing where the extra parens can be added here. Here is another way of writing this:
let DetailComponent = 'div'
if (detailLink || onDetailClick) DetailComponent = 'a'
👻 LGTM, will pull and test locally if you want before merging. |
e5af50b
to
4cd81a9
Compare
This PR adds support for the
multiple
dropdown type. A multiple dropdown:value
(opposed to string/number)Other updates and fixes:
search