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

Fix dropdown set value and error #310

Merged
merged 2 commits into from
Jun 28, 2016
Merged

Conversation

levithomason
Copy link
Member

No description provided.


/* eslint-disable no-console */
if (nextProps.multiple && !isNextValueArray) {
if (hasValue && nextProps.multiple && !isNextValueArray) {
Copy link
Member Author

Choose a reason for hiding this comment

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

We should not throw these dev errors regarding value unless there is actually a value.

@dvdzkwsk
Copy link
Member

👻

this.onChange(e, _.union(this.state.value, [value]))
const newValue = _.union(this.state.value, [value])
this.setValue(newValue)
this.onChange(e, newValue)
Copy link
Member Author

Choose a reason for hiding this comment

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

This should arguably be handled by trySetState, but we're handling in the component for now.

@levithomason levithomason merged commit 5cd8460 into master Jun 28, 2016
@levithomason levithomason deleted the feature/fix-dropdown-value branch June 28, 2016 18:08
jhchill666 pushed a commit to jhchill666/stardust that referenced this pull request Jul 5, 2016
* fix(Dropdown): only throw val prop error if val prop

* fix(Dropdown): setValue to correct type on click/enter
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.

2 participants