Updates tom_select_helper.rb with the recent changes from master

This commit is contained in:
filipefurtad0
2024-02-12 16:00:16 +00:00
committed by David Cook
parent 0fa272a125
commit 0a4c2a1903

View File

@@ -15,8 +15,8 @@ module TomSelectHelper
def tomselect_search_and_select(value, options)
tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper")
tomselect_wrapper.find(".ts-control").click
tomselect_wrapper.find(:css, '.ts-dropdown input.dropdown-input').set(value)
tomselect_wrapper.find(".ts-control").click
# Use send_keys as setting the value directly doesn't trigger the search
tomselect_wrapper.find(:css, '.ts-dropdown input.dropdown-input').send_keys(value)
tomselect_wrapper.find(:css, '.ts-dropdown .ts-dropdown-content .option', text: value).click
end