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

renderSelectedChoices doesn't working with groups #253

Closed
NetanelBasal opened this issue Sep 17, 2017 · 5 comments
Closed

renderSelectedChoices doesn't working with groups #253

NetanelBasal opened this issue Sep 17, 2017 · 5 comments

Comments

@NetanelBasal
Copy link

NetanelBasal commented Sep 17, 2017

Hey,

I am trying to use the group option with renderSelectedChoices set to always, and it's not working.

 choicesGroup = [ {
    label: 'Group one',
    id: 1,
    choices: [
      {value: 'Child One', label: 'Child One'},
      {value: 'Child Two', label: 'Child Two'},
    ]
  },
    {
      label: 'Group two',
      id: 2,
      choices: [
        {value: 'Child Four', label: 'Child Four'}
      ]
    } ];

this.choices.setChoices(choicesGroup, this.valueKey, this.labelKey, true);

When I select an item, it disappears from the list. I can confirm it is working with the following example:

const choices = [
  {value: 'One', label: 'Label One'},
  {value: 'Two', label: 'Label Two'},
  {value: 'Three', label: 'Label Three'},
];
this.choices.setChoices(choices, this.valueKey, this.labelKey, true);

It seems there is a bug when using groups or I am missing something?
Thanks.

@maximmig
Copy link
Contributor

I confirm this bug. I'll create a PR to fix it as soon as my current PR gets accepted or rejected. Thanks!

maximmig added a commit to maximmig/Choices that referenced this issue Sep 19, 2017
maximmig added a commit to maximmig/Choices that referenced this issue Sep 19, 2017
maximmig added a commit to maximmig/Choices that referenced this issue Sep 19, 2017
maximmig added a commit to maximmig/Choices that referenced this issue Sep 19, 2017
jshjohnson added a commit that referenced this issue Sep 20, 2017
@m-grzybek-first10
Copy link

Did someone pick this up ?

@m-grzybek-first10
Copy link

I could give it a go

@m-grzybek-first10
Copy link

Nevermind, just notice that @maximmig fixed it. @jshjohnson when will that but be merged in to master branch? We're using this lib on production and it would be super helpful. Thanks :)

@jshjohnson
Copy link
Collaborator

I believe this has now been resolved 👍

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

No branches or pull requests

4 participants