Commit 97955a17 97955a17060fb4888e7a124c826b159ec1acd7be by Nicolas Perriault

fixed #368 - check that a link still exists after click for processing further

1 parent 69ee25c6
......@@ -4,6 +4,7 @@ CasperJS Changelog
XXXX-XX-XX, v1.0.2
------------------
- fixed [#368](https://github.com/n1k0/casperjs/issues/368) - Remote JS error is thrown when a click target is missing after `click()`
- merged PR [#357](https://github.com/n1k0/casperjs/pull/357) - fire the `input` event after setting input value (required to support [angular.js](http://angularjs.org/) apps)
2013-01-17, v1.0.1
......
......@@ -389,7 +389,10 @@ Casper.prototype.click = function click(selector) {
this.checkStarted();
var success = this.mouseEvent('click', selector);
this.evaluate(function(selector) {
document.querySelector(selector).focus();
var element = __utils__.findOne(selector);
if (element) {
element.focus();
}
}, selector);
return success;
};
......