Open abuisman opened 8 years ago
Tested my PR in our project and it works. So feel free to test it yourself and merge when approved.
P.s. are there any specs? I didn't see them.
Ran into this issue today as well. Any timeline for the merge?
Is there any updates on this? Seems that optgroup is incompatible with this.
Hi,
I am trying to select an option in my select2 that is inside an optgroup.
The error in capybara I get is:
Ambiguous match, found 2 elements matching css ".select2-dropdown li.select2-results__option" with text "Käpt’n Blaubär? (m)"
I called
select2
like so:select2 'Käpt’n Blaubär? (m)', css: '.select2-container'
My select2 with dummy data looks like this:
I suspect the ambiguity is caused by the fact that optgroups also have a 'select2-results__option' class:
So there are 2 elements that contain the text 'Käpt’n Blaubär? (m)', the group 'Boten' and the item itself.
A fix would be to add the role attribute into the selection for items
[role=treeitem]