Choices: renderSelectedChoices doesn't working with groups

Created on 17 Sep 2017  路  5Comments  路  Source: Choices-js/Choices

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.

accepting PRs bug

Most helpful comment

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

All 5 comments

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

Did someone pick this up ?

I could give it a go

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 :)

I believe this has now been resolved 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zslabs picture zslabs  路  6Comments

ckotzbauer picture ckotzbauer  路  5Comments

NetanelBasal picture NetanelBasal  路  6Comments

mpreziuso picture mpreziuso  路  3Comments

jchamb picture jchamb  路  4Comments