Skip to content
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

handle options with value 0 properly #1310

Closed
wants to merge 2 commits into from

Conversation

andreme
Copy link
Contributor

@andreme andreme commented Oct 16, 2016

fixes #1284

@coveralls
Copy link

Coverage Status

Coverage decreased (-59.0%) to 33.29% when pulling 38dc104 on andreme:allow_options_with_value_0 into b4a087e on JedWatson:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 92.267% when pulling 341cc07 on andreme:allow_options_with_value_0 into b4a087e on JedWatson:master.

@@ -553,7 +553,7 @@ const Select = React.createClass({
* @param {Object} nextProps - optionally specify the nextProps so the returned array uses the latest configuration
* @returns {Array} the value of the select represented in an array
*/
getValueArray (value, nextProps) {
getValueArray (value, nextProps = undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? is not the default behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right, but my IDE was warning me that this function was sometimes called with only 1 argument. I thought making it explicit wouldn't hurt.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This param being optional should be indicated in the jsdoc http://usejsdoc.org/tags-param.html#optional-parameters-and-default-values, which should also stop the IDE warning

@msaglietto
Copy link

Nice it looks good to me, I agree that 0 it a possible value should not be consider as empty 👍

@grumd
Copy link

grumd commented Nov 22, 2016

Is this going to be merged any time soon?

@hillerstorm
Copy link

No merged PRs since mid-november? Would really like this one to land :/

@bmv437
Copy link

bmv437 commented Apr 26, 2017

It would be great to get this merged 👍

@gwyneplaine
Copy link
Collaborator

Thanks for this @andreme, this has been fixed elsewhere in #1395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clearable icon doesn't show on value = 0
8 participants