goodwill / capybara-select2

Helper for capybara to be able to trigger select on select2 javascript (needed for js enabled test only)
MIT License
80 stars 111 forks source link

Add treeitem to option selector (optgroup support) #47

Open abuisman opened 8 years ago

abuisman commented 8 years ago

There is an issue with optgroups because the labels of the optgroups also have the class select2-results__option. Adding the role to the selector fixes this issue.

More details about the issue here. https://github.com/goodwill/capybara-select2/issues/46

Zeragamba commented 7 years ago

Ah, that is true. Never mind then.

On Wed, Sep 28, 2016, 2:02 AM Achilleas notifications@github.com wrote:

@abuisman commented on this pull request.

In gem/lib/capybara-select2.rb https://github.com/goodwill/capybara-select2/pull/47:

@@ -40,7 +40,7 @@ def select2(value, options = {}) [value].flatten.each do |value| if find(:xpath, "//body").has_selector?("#{drop_container} li.select2-results__option")

Thanks for the review.

Should it? Did you run into a situation where this was an issue? I am asking because the comment on line 42 says 'select2 version 4.0' which might indicate that the API is not always the same.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/goodwill/capybara-select2/pull/47, or mute the thread https://github.com/notifications/unsubscribe-auth/ACN74WIpMmLRXB7Uj5jbLUWMhuAbQZwVks5qugG0gaJpZM4Ivyew .