From a2b558e7a4b8f948643fb8e5662d8a7e619b3431 Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Wed, 4 Aug 2021 09:20:27 -0400 Subject: [PATCH] BUG:3614 detect defect value and handle change --- src/utils/ColorPicker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/ColorPicker.js b/src/utils/ColorPicker.js index 62d8ef097..e7fac217f 100644 --- a/src/utils/ColorPicker.js +++ b/src/utils/ColorPicker.js @@ -207,6 +207,7 @@ export default function($, undefined) { resize = throttle(reflow, 10), visible = false, isDragging = false, + isDefault = true, dragWidth = 0, dragHeight = 0, dragHelperHeight = 0, @@ -782,6 +783,7 @@ export default function($, undefined) { isEmpty = true; } else { isEmpty = false; + isDefault = !color; // if no color is available an empty string will be passed. tinycolor will then set it to #000 newColor = tinycolor(color); newHsv = newColor.toHsv(); @@ -956,7 +958,7 @@ export default function($, undefined) { function updateOriginalInput(fireCallback) { var color = get(), displayColor = '', - hasChanged = !tinycolor.equals(color, colorOnShow); + hasChanged = isDefault ? true : !tinycolor.equals(color, colorOnShow); if (color) { displayColor = color.toString(currentPreferredFormat);