Skip to content

Commit

Permalink
Merge pull request #154 from scaleflex/FRA-6061-fix-colorpicker-not-u…
Browse files Browse the repository at this point in the history
…pdating

Fra 6061 fix ColorPicker not updating
  • Loading branch information
amrelbialy authored Aug 5, 2024
2 parents 0072ee0 + 0a49026 commit 550cdab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/ui/src/core/color-picker/color-picker.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ const ColorPicker = intrinsicComponent<ColorPickerProps, HTMLDivElement>(
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);
}
};

Expand Down Expand Up @@ -282,6 +282,7 @@ const ColorPicker = intrinsicComponent<ColorPickerProps, HTMLDivElement>(

const barPointSliding = useDrag(updateBarColor, updateBarColor, null);
const rangePickerPointSliding = useDrag(updateRangePickerColor, updateRangePickerColor, null);

return (
<Styled.ColorPickerWrapper ref={ref} {...rest}>
<Styled.ColorPickerAction>
Expand Down

0 comments on commit 550cdab

Please sign in to comment.