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

jQuery's live events don't work

Open madadam opened this issue 15 years ago • 4 comments

Hello there,

Seems capybara-envjs has troubles with jQuery's live events. If an event listener is bound using bind(), everything works fine, but if using live(), it does not. I put together simple example to demonstrate it:

http://github.com/madadam/capybara-envjs-jquery-live-failure-example

Just run ruby -rubygems test.rb to see it. With selenium driver, it works fine, with envjs, it fails.

madadam avatar Oct 01 '10 12:10 madadam

Yup. Known issue. But so far, no one that has the need to make it work has stepped up to work on it, I'm afraid.

smparkes avatar Oct 01 '10 13:10 smparkes

I'd step up, why not :) Is the problem only in capybara-envjs or is it envjs itself?

madadam avatar Oct 01 '10 13:10 madadam

That'd be cool, if you could.

The problem is in envjs itself and it might be fixed in the Java master (we want to remerge, but it's going take a chunk of time we never seem to find ... the java master underwent a big reorg after the ruby port, before a merge).

The relevant code in the ruby branch is in window/event.js, dispatchEvent in particular. I haven't been tracking what this looks like in the java master lately.

smparkes avatar Oct 01 '10 13:10 smparkes

If you try calling a focus before clicking the element, it seems to work:

page.execute_script %Q{ $("#derp").trigger("focus") }
find("#derp").click

kevintraver avatar Sep 24 '13 19:09 kevintraver