Closed TheWizz closed 8 years ago
Hi @TheWizz,
The if
surrounding this if
used to have that check, but it got removed to fix another bug. I have now added that check for the $setDirty()
if
.
Fixed in commit 414598af694e46aed763889101879c95d74ef5a3 and released in v2.1.5
Thanks!
-JM
On 19 jul 2016, at 23:57, Ruhley notifications@github.com wrote:
Hi @TheWizz,
The if surrounding this if used to have that check, but it got removed to fix another bug. I have now added that check for the $setDirty() if.
Fixed in commit 414598a and released in v2.1.5
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
The color picker calls $setDirty() once immedately after being instantiated, even if there's no change to the model.This happens if there's already a value set on the model (not if the model value is undefined).
I was able to fix this by changing the watchNgModel function from this:
to this
I.e., comparing "oldValue !== newValue" rather than "oldValue !== undefined". This seems to be more in the spirit of when to call $setDirty() (i.e., when there's some real change to the data), and I haven't seen any problem after making this change. If you believe this is correct, I would appreciate if you could apply this simple change. Thanks.
-JM