From 2aa55c9b916ba36ca8845cc88b4d2b2147ccc3c9 Mon Sep 17 00:00:00 2001 From: mohamed Date: Mon, 5 Aug 2024 14:50:25 +0300 Subject: [PATCH] fix(ColorPicker): not updating rgb color correct [FRA-6061] --- .../ui/src/core/color-picker/color-picker.component.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/core/color-picker/color-picker.component.tsx b/packages/ui/src/core/color-picker/color-picker.component.tsx index c3124f33..30c11db5 100644 --- a/packages/ui/src/core/color-picker/color-picker.component.tsx +++ b/packages/ui/src/core/color-picker/color-picker.component.tsx @@ -112,16 +112,16 @@ const ColorPicker = intrinsicComponent( const newHexColor = rgbToHex(...rgbArr); setRgbColorValue([...rgbArr]); + if (validateHex(newHexColor)) { setRangePicker({ ...rangePicker, color: newHexColor, }); + changeBarPosByColor(newHexColor); - if (typeof onChange === 'function') { - onChange(rangePicker.color, getRgbColor(newHexColor), filterTransparentColor(localPinnedColors)); - } + changeRangePickerPointerPosByColor(newHexColor); } }; @@ -282,6 +282,7 @@ const ColorPicker = intrinsicComponent( const barPointSliding = useDrag(updateBarColor, updateBarColor, null); const rangePickerPointSliding = useDrag(updateRangePickerColor, updateRangePickerColor, null); + return (