resurrectio icon indicating copy to clipboard operation
resurrectio copied to clipboard

Unable to record scripts if bootstrap-dropdown.js is included

Open dzwicker opened this issue 11 years ago • 2 comments

Hi,

we use casperjs for our web tests and i have tried to record some basic scripts with resurrectio. But on our web pages nothing was recorded. I started to reduce the page content to figure out what the problem is. I thing the problem is located in the bootstrap-dropdown.js lib. I will attach a zip (png just rename) with 2 files as test case. The html page and the bootstrap script. I disable the bootstrap script and record everything will work and the click to the button is recorder. But with the bootstrap script no click is recorded.

test

dzwicker avatar Feb 20 '14 20:02 dzwicker

Hi,

That's probably caused by event propagation stopped somewhere, but at first sight, I do not see anything harmful in bootstrap-dropdown.js. I will test more precisely to find out.

ebrehault avatar Feb 20 '14 23:02 ebrehault

ok I found the problem. In bootstrap-dropdown.js, line 161, you have: .on('click.dropdown-menu', function (e) { e.stopPropagation() }) As there is no selector, it stops the propagation to any click. It should be something like: .on('click.dropdown-menu', '.dropdown', function (e) { e.stopPropagation() })

Maybe that's fixed in a newer version of bootstrap 2.

Nevertheless, the problem will remain anyway for the dropdown menu itself: as progation is stopped, resurrectio will not get the click event. So we probably need to overload the stopPropagation method to make sure resurrectio always gets informed of anything happening.

ebrehault avatar Feb 21 '14 09:02 ebrehault