fix : color picker absoulute bug

This commit is contained in:
2026-09-15 18:06:24 +07:00 Unverified
parent 45f11466fe
commit 0f48989e9c
2 changed files with 84 additions and 58 deletions
@@ -88,6 +88,7 @@ import {
} from "@/components/ui/popover";
import {
ColorPicker,
ColorPickerEyeDropper,
ColorPickerHue,
ColorPickerSelection,
} from "@/components/ui/color-picker";
@@ -571,7 +572,7 @@ function ColorField({
}) {
const invalid = !normalizeHex(value);
const handlePickerChange = useCallback(
(color: number[] | Record<string, number>) => {
(color: unknown) => {
if (!Array.isArray(color)) return;
const hex = color
.slice(0, 3)
@@ -610,6 +611,7 @@ function ColorField({
>
<ColorPickerSelection className="h-32" />
<ColorPickerHue />
<ColorPickerEyeDropper aria-label="ดูดสีจากหน้าจอ" />
</ColorPicker>
</PopoverContent>
</Popover>