Closed klappar closed 8 years ago
This is unfortunately because of the tinycolor
library that is being used. If the format is hsl
or hsv
and the lightness is 100% then tinycolor will always set hue and saturation to 0.
But shouldn't the swatch background-color be updated on model rebind/change? I can only find that in the else block handling an empty/invalid color.
I'm sure I'm missing something here...
The watch on ngModel
sets the hue, saturation and lightness if the color is valid. These fields then have their own watchers that will update the positions of the selectors and the swatch background color.
@klappar I will close this ticket, but feel free to re-open it if you manage to track down the problem. A jsfiddle or plunkr would be great to help me.
The color picker does not update the swatch background when the model changes or rebinds. After opening und closing the color picker the swatch updates and displays the right color. I guess a call to
$scope.update()
inside of the$scope.$watch('ngModel',...)
-block would solve the problem.