diff --git a/lib/OpenLayers/Handler/Click.js b/lib/OpenLayers/Handler/Click.js
index 0ff5246c12..4195fd0b51 100644
--- a/lib/OpenLayers/Handler/Click.js
+++ b/lib/OpenLayers/Handler/Click.js
@@ -45,12 +45,12 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
/**
* APIProperty: pixelTolerance
* {Number} Maximum number of pixels between mouseup and mousedown for an
- * event to be considered a click. Default is null. If set to an
+ * event to be considered a click. Default is 0. If set to an
* integer value, clicks with a drag greater than the value will be
* ignored. This property can only be set when the handler is
* constructed.
*/
- pixelTolerance: null,
+ pixelTolerance: 0,
/**
* APIProperty: stopSingle
@@ -182,7 +182,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
*/
passesTolerance: function(evt) {
var passes = true;
- if(this.pixelTolerance && this.down) {
+ if(this.pixelTolerance != null && this.down) {
var dpx = Math.sqrt(
Math.pow(this.down.x - evt.xy.x, 2) +
Math.pow(this.down.y - evt.xy.y, 2)
diff --git a/tests/Handler/test_Click.html b/tests/Handler/test_Click.html
index 39c478fdae..c0fe4a30b5 100644
--- a/tests/Handler/test_Click.html
+++ b/tests/Handler/test_Click.html
@@ -43,7 +43,7 @@
}
function test_Handler_Click_events(t) {
- t.plan(30);
+ t.plan(35);
var map = new OpenLayers.Map('map');
var control = {
@@ -72,8 +72,8 @@
// list below events that should be handled (events) and those
// that should not be handled (nonevents) by the handler
- var events = ["click", "dblclick"];
- var nonevents = ["mousedown", "mousemove", "mouseup", "resize", "focus", "blur"];
+ var events = ["click", "dblclick", "mousedown"];
+ var nonevents = ["mousemove", "mouseup", "resize", "focus", "blur"];
var handler = new OpenLayers.Handler.Click(control);
// set browser event like properties on the handler
for(var i=0; i