Commit 27440007 274400077b503173f3a0b720fe113c10d0eaf079 by Nicolas Perriault

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

1 parent 52dff353
......@@ -69,6 +69,7 @@ None yet.
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
......
......@@ -403,7 +403,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;
};
......