Skip to content

Commit

Permalink
fix(ColorPicker): unable to set R/G/B components as 0 (#4466)
Browse files Browse the repository at this point in the history
  • Loading branch information
plagoa authored Dec 4, 2024
1 parent c9adeda commit 4d40f7f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/core/src/ColorPicker/Fields/Fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ export const Fields = (props: FieldsProps) => {
},
event,
);
} else if (data.r || data.g || data.b) {
} else if (
data.r !== undefined ||
data.g !== undefined ||
data.b !== undefined
) {
onChange(
{
r: data.r || rgb?.r,
g: data.g || rgb?.g,
b: data.b || rgb?.b,
r: data.r ?? rgb?.r,
g: data.g ?? rgb?.g,
b: data.b ?? rgb?.b,
source: "rgb",
},
event,
Expand Down

0 comments on commit 4d40f7f

Please sign in to comment.