Skip to content

Commit

Permalink
fix(ColorPicker): hue slider goes out of bounds (#4465)
Browse files Browse the repository at this point in the history
  • Loading branch information
plagoa authored Dec 4, 2024
1 parent 4d40f7f commit 75ad7f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/core/src/ColorPicker/Picker/Picker.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ export const { staticClasses, useClasses } = createClasses(name, {
marginLeft: "0px",
border: "2px solid #fff",
borderRadius: theme.radii.circle,
transform: "translate(0, -2px)",
"&.vertical": {
transform: "translate(0px, -2px)",
},
"&.horizontal": {
transform: "translate(-6px, -2px)",
},
},
title: {
fontWeight: theme.fontWeights.semibold,
Expand Down
13 changes: 10 additions & 3 deletions packages/core/src/ColorPicker/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,23 @@ const Component = (props: PickerProps) => {
classes: classesProp,
} = useDefaultProps("HvColorPickerPicker", props);
const { activeTheme } = useTheme();
const { classes } = useClasses(classesProp);
const { classes, cx } = useClasses(classesProp);

const SaturationPointer = useCallback(
() => <div className={classes?.saturationPointer} />,
[classes?.saturationPointer],
);

const HueSlider = useCallback(
() => <div className={classes?.hueSlider} />,
[classes?.hueSlider],
() => (
<div
className={cx(
classes?.hueSlider,
activeTheme?.colorPicker.hueDirection,
)}
/>
),
[activeTheme?.colorPicker.hueDirection, classes?.hueSlider, cx],
);

return (
Expand Down

0 comments on commit 75ad7f6

Please sign in to comment.