onChange fires when mouse is down, even if value is not changing
If a user is holding down the mouse button whilst moving the mouse around the color picker, the onchange event fires... unless the user is holding the mouse button down over one spot, without moving, in this case the value is not actually changing and so the event should not fire.
I can filter this out in my code, but seemed sensible to make onchange do what it is supposed to do.
I think it's fixed in the latest version of my fork. Can you confirm that?
Yes indeed, it is fixed. I thought I had used your fork, not sure how I got an old version.
Thanks for your work on this
I have no idea what I was talking about. onchange still fires whenever the mouse button is held down, even if the value is not changing. I must have had my workaround in place when I closed this.
I have tried several branches, but cannot find a fix.
Browser and OS please. Example code if possible. Honestly can't confirm it with the fork atm. Only fires when mouse is moved :(
This is broken for me in Chrome 43.0.2357.81m Working in Firefox Working in IE11
The simplified code I'm using
$('#example-flat').colpick({
color:'123456',
flat:true,
layout:'hex',
submit: false,
onChange: function(hsb, hex, rgb, bySetColor) {
//ajax call to the api to change the colour
$.ajax({
method : "PUT",
url : "/api/color/" + hex,
success : function(data) {
$('#debug').val('color changed to: ' + hex);
}
});
}
});