Permalink
Browse files

Improve focus handling by relying on Javascript focus()

  • Loading branch information...
1 parent ba28a2a commit a4eb401da4e6e18e9f408c08dd423b8d5720b388 @jferris jferris committed Jul 11, 2012
Showing with 2 additions and 4 deletions.
  1. +1 −0 spec/selenium_compatibility_spec.rb
  2. +1 −4 src/capybara.js
@@ -31,6 +31,7 @@
compare_events_for_drivers(:reusable_webkit, :selenium) do
visit "/"
fill_in "One", :with => "some value"
+ fill_in "One", :with => "a new value"
fill_in "Two", :with => "other value"
click_button "Submit"
end
View
@@ -250,10 +250,7 @@ Capybara = {
},
focus: function(index) {
- if (this.focusedIndex)
- this.trigger(this.focusedIndex, "blur");
- this.focusedIndex = index;
- this.trigger(index, "focus");
+ this.nodes[index].focus();
},
selectOption: function(index) {

0 comments on commit a4eb401

Please sign in to comment.