Closed jayschab closed 10 years ago
When translating a list with <optgroup>'s select2 will use the following structue:
<optgroup>
div.select2-drop ul.select2-results li.select2-result.select2-result-unselectable div ul.select2-result-stub li.select2-result.select2-result-selectable li.select2-result.select2-result-selectable ... li.select2-result.select2-result-unselectable ...
The old "#{drop_container} li" selector would lead to Capybara::Ambiguous error complaining that:
"#{drop_container} li"
Capybara::Ambiguous
Ambiguous match, found 2 elements matching css ".select2-drop li" with text "..."
because of the additional <li> at the optgroup level.
<li>
This change adds a selector for "select2-result-selectable" to ignore such headers.
"select2-result-selectable"
When translating a list with
<optgroup>
's select2 will use the following structue:The old
"#{drop_container} li"
selector would lead toCapybara::Ambiguous
error complaining that:Ambiguous match, found 2 elements matching css ".select2-drop li" with text "..."
because of the additional
<li>
at the optgroup level.This change adds a selector for
"select2-result-selectable"
to ignore such headers.