angular-bootstrap-colorpicker icon indicating copy to clipboard operation
angular-bootstrap-colorpicker copied to clipboard

Model updates while I'm dragging the color-picker

Open BadgerBadgerBadgerBadger opened this issue 11 years ago • 3 comments

So basically, when using the color-picker, I do not want my model updating when I drag on the color-picker. I only want my model updated when I'm done dragging and let go.

Any ideas on how to do this?

Hi, probably an outdated answer, but all you have to do is to find "mousemove" function and remove

if(ngModel) {
  $scope.$apply(ngModel.$setViewValue(newColor));
}

then at the beginning of "mouseup" function add this:

if(ngModel) {
  $scope.$apply(ngModel.$setViewValue(pickerColor[thisFormat]()));
}

It's a nice performance boost. I wonder if people need to update the model on every mousedown event.

buberdds avatar Dec 22 '14 16:12 buberdds

$scope.$on("colorpicker-selected") works perfect for me. But the only problem is, that entering a color in the colorpicker-input field doesn't trigger that event... any chance this will be implemented?

best regards p.s.: thx for the great and simple colorpicker!

enthusiasmus avatar Mar 06 '16 11:03 enthusiasmus

I have been using '$scope.$on("colorpicker-selected")' and it works well for only getting called when a color is selected.

Small issue (unless it's wanted functionality) encountered, though...

So when I drag around the cross-hairs the color returned in that callback works perfectly. The problem I have been having is when I simply click somewhere in the color-picker - the color returned in the callback does not get updated to my new click location. I'd be happy to elaborate on that if I'm making no sense.

aschroederSportsdigita avatar Aug 17 '17 17:08 aschroederSportsdigita