From 9ed34ed9ac80120b0dc236c74db00875a4e5bd18 Mon Sep 17 00:00:00 2001 From: eireland Date: Mon, 28 Oct 2024 12:50:06 -0700 Subject: [PATCH] Adds the non-standard swatch to palette as user selects a color in the color picker. --- .../data-display/inspector/point-color-setting.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v3/src/components/data-display/inspector/point-color-setting.tsx b/v3/src/components/data-display/inspector/point-color-setting.tsx index 33c5d5300..5e661c770 100644 --- a/v3/src/components/data-display/inspector/point-color-setting.tsx +++ b/v3/src/components/data-display/inspector/point-color-setting.tsx @@ -43,6 +43,7 @@ export const PointColorSetting = observer(function PointColorSetting({onColorCha const updateValue = useCallback((value: string) => { setInputValue(value) + setNonStandardColorSelected(true) if (attrType === "categorical") { (onColorChange as (color: string, cat: string) => void)(value, propertyLabel) } else if (attrType === "numeric") { @@ -54,6 +55,8 @@ export const PointColorSetting = observer(function PointColorSetting({onColorCha const rejectValue = useCallback(() => { setShowColorPicker(false) + setOpenPopover(null) + setNonStandardColorSelected(false) }, []) const acceptValue = useCallback(() => { @@ -68,10 +71,6 @@ export const PointColorSetting = observer(function PointColorSetting({onColorCha evt.stopPropagation() setShowColorPicker(!showColorPicker) } - - // const baseColors = ["#000000", "#a9a9a9", "#d3d3d3", "#FFFFFF"] - // const standardSwatchColors = [...baseColors, ...kellyColors.slice(0, 12)] - useEffect(() => { const adjustPosition = () => { const popover = popoverRef.current