Browse Source

Merge pull request #3670 from HCL-TECH-SOFTWARE/issue-3614 - Fixes #3614

BUG:3614 detect default value and handle change
pull/3692/head
Artur Arseniev 5 years ago
committed by GitHub
parent
commit
112cb71380
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/utils/ColorPicker.js

4
src/utils/ColorPicker.js

@ -209,6 +209,7 @@ export default function($, undefined) {
resize = throttle(reflow, 10),
visible = false,
isDragging = false,
isDefault = true,
dragWidth = 0,
dragHeight = 0,
dragHelperHeight = 0,
@ -784,6 +785,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();
@ -958,7 +960,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);

Loading…
Cancel
Save