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

Selector for Options #2672

Closed
Kondzolko opened this issue Oct 27, 2021 · 3 comments
Closed

Selector for Options #2672

Kondzolko opened this issue Oct 27, 2021 · 3 comments

Comments

@Kondzolko
Copy link

Hello everyone and want to say thank you for your js library, I'm not sure if I'm on the right place but I would like to report one 1 bug with groups selectpicker.

Options for groups generated from the first group.

So if we will have options like this

<optgroup label="Fruit">
  <option>Apple</option>
  <option>Orange</option>
</optgroup>

<optgroup label="Vegetable">
  <option>Corn</option>
  <option>Carrot</option>
</optgroup>
   

We will don't see options 'Corn' and 'Carrot'.

https://plnkr.co/edit/vZ9xghMuDhHFJKMc?preview

I Will be appreciative if somebody can take a look at that, I also will try to see if I can fix this problem and will share with you a solution if I will find it.

Thanks

Originally posted by @Kondzolko in #2505 (comment)

@Kondzolko
Copy link
Author

I found where is the problem.
For Some reason we all the time sent index 0 'StartIndex'

the problem in line 1770 in this code
addOptgroup.call(this, startIndex, selectOptions);

please replace to
addOptgroup.call(this, i, selectOptions);

An example of code you can find here:
https://plnkr.co/edit/amuqKRkRe829UEVC?preview

@Rezyan
Copy link

Rezyan commented Nov 22, 2021

Hi,

You can use this workaround.

Regards

@caseyjhol
Copy link
Member

Duplicate of #2607.

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

No branches or pull requests

3 participants