mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Use JS to clear field, should be more performant
This commit is contained in:
parent
7859efb757
commit
08a8fd6834
1 changed files with 2 additions and 2 deletions
|
@ -32,8 +32,8 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
|||
path_names = value.to_s.empty? ? [] : value
|
||||
native.send_keys(*path_names)
|
||||
elsif tag_name == 'textarea' or tag_name == 'input'
|
||||
chars = native[:value].size
|
||||
native.send_keys(([:right] * chars) + ([:backspace] * chars) + [ value.to_s ])
|
||||
driver.browser.execute_script "arguments[0].value = ''", native
|
||||
native.send_keys(value.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue