Closed kareljuricka closed 6 years ago
Can you give some steps to reproduce the error?
Did you change the value not with the color picker, but via some other method, then the color picker got confused? Is this what you mean?
I'm passing to color picker value from variable. I don't change value of that color outside. But when I use color e.g. #897A7A , some algorithm in your module changed it to #8A7B7B (without any action with mouse etc.). Outside I catching that colorChange event, and there I set that variable to new value and I noticed there that initial color is not same as startHex - actually two triggers of colorChange event are called, first with startHex color, second with 'algorithm' changed color.
do you use ng-color-picker
or ng-color-picker-preview
?
ng-color-picker
Could you do me a favour and reproduce it in a Plunkr? I tried to reproduce it just now with #897A7A
and it works fine for me.
This would greatly help me find the source of the problem ðŸ˜
Thanks!
Edit: colorChange()
fires once for me per click also, not twice
@kareljuricka I have made a Plunkr for you so you can reproduce this:
http://plnkr.co/edit/N2VKBCrNNIwInwI8PVOu?p=preview
Let me know if you still have any troubles.
Thanks!
It's interesting that when I use that 897A7A color in plunker, it's not changed to 8A7B7B. I found a way to simulate that error when I set that startHex to undefined. It's same error, but here with change from undefined to a specific color.
Check console log here - http://plnkr.co/edit/pwTaZ1ZcY95DwtcIgFV8?p=preview
Seems to be fixed in 4.1.0
, closing!
In some cases when using startHex - seems like it depend on color - I got that error - ERROR Error when ngColor picker is displayed - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '#897A7A'. Current value: '#8A7B7B'.
The value I use in startHex is 897A7A but ngColor module recalculates it to 8A7B7B and then trigger that error message.
I noticed that also colorChange event is called twice.
I'm using color property binding with [startHex]="colorVariable". When I add directly some string to startHex property, the error does not appear.