ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

Swap order of watchers to fix re initialisation issue. #169

Closed stephennancekivell closed 7 years ago

stephennancekivell commented 7 years ago

Hi, we have a strange bug where re initialisation shows the wrong color. Changing the order of these watchers fixes it.

See in the gif. After refreshing the page the swatch correctly shows the correct color. Then I click back and forth in our in page navigation the swatch is incorrectly showing black. The in page navigation is basically a ng-if, and our app is component style, lots of nested directives.

color-picker-re-initalisation

I tried to create a unit test to show the problem, but was unable to reproduce the problem with a simple directive.