capybara-select2 icon indicating copy to clipboard operation
capybara-select2 copied to clipboard

Fix select2 version 4 support to handle grouped options

Open Empact opened this issue 8 years ago • 0 comments

When options are grouped, their group has the class select2-results__option, and the attribute role=group. Absent this fix, that means selections against grouped fields result in:

Capybara::Ambiguous:
  Ambiguous match, found 2 elements matching visible css ".select2-dropdown li.select2-results__option" with text "TEXT" within #<Capybara::Node::Element tag="body" path="/html/body">

The fix is to exclude the group options on lookup.

Empact avatar Nov 10 '17 01:11 Empact