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 using <Placeholder> and <Option> array together #161

Closed
andreychev opened this issue Jul 29, 2015 · 10 comments
Closed

Fix using <Placeholder> and <Option> array together #161

andreychev opened this issue Jul 29, 2015 · 10 comments
Labels

Comments

@andreychev
Copy link

<Select value={ value } defaultValue={ defaultValue } onUpdate={ onChange } >
  <Placeholder>{ placeholder }</Placeholder>
  {
    options.map((o) => {
      return (<Option key={ o.id } value={ option.id } >{ option.name }</Option>);
    });
  }
</Select>
Invalid children supplied to `Belle Select`, expected an Option or Placeholder component from Belle. Check the render method of `Dropdown`.
@nikgraf
Copy link
Owner

nikgraf commented Jul 29, 2015

@andreychev thx for reporting, will look into this today or tomorrow

@nikgraf nikgraf added the bug label Jul 29, 2015
@jpuri
Copy link
Collaborator

jpuri commented Jul 29, 2015

Its coming from line: Select.jsx line:62
I guess issue is that when we use above way of giving options, the type is somehow not coming correct.

One trouble is also that options.map returns an array, placeholder has been given as separate component but should have been part of array.

placeholder + array !== array

@chrisvariety
Copy link

Workaround for now: [<Placeholder>Foo bar</Placeholder>].concat(options.map(...))

@jpuri
Copy link
Collaborator

jpuri commented Aug 7, 2015

This has been fixed with PR #148
Soon there will be a release we well :)

@luisrudge
Copy link

any ETA on this PR? I just got bitten by this as well :)

@jpuri
Copy link
Collaborator

jpuri commented Aug 16, 2015

:) this should be merged and released in 1-2 days.

@nikgraf
Copy link
Owner

nikgraf commented Aug 19, 2015

@luisrudge Will cut a release with this today 😄

@nikgraf nikgraf closed this as completed Aug 19, 2015
@nikgraf
Copy link
Owner

nikgraf commented Aug 19, 2015

@andreychev we cut a release today - problem solved 😄

@luisrudge
Copy link

Thanks @nikgraf and @jpuri!

@andreychev
Copy link
Author

@nikgraf @jpuri good job, thx :)

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

No branches or pull requests

5 participants