Skip to content

Commit 7817113

Browse files
committed
fix color picker
1 parent fa748bb commit 7817113

File tree

1 file changed

+6
-3
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu

1 file changed

+6
-3
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu/context-menu.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function ColorGrid({
7575
case ' ':
7676
e.preventDefault()
7777
e.stopPropagation()
78+
setHexInput(WORKFLOW_COLORS[index].color)
7879
onColorChange?.(WORKFLOW_COLORS[index].color)
7980
return
8081
default:
@@ -86,7 +87,7 @@ function ColorGrid({
8687
buttonRefs.current[newIndex]?.focus()
8788
}
8889
},
89-
[onColorChange]
90+
[setHexInput, onColorChange]
9091
)
9192

9293
return (
@@ -103,13 +104,15 @@ function ColorGrid({
103104
tabIndex={focusedIndex === index ? 0 : -1}
104105
onClick={(e) => {
105106
e.stopPropagation()
106-
onColorChange?.(color)
107+
setHexInput(color)
107108
}}
108109
onKeyDown={(e) => handleKeyDown(e, index)}
109110
onFocus={() => setFocusedIndex(index)}
110111
className={cn(
111112
'h-[20px] w-[20px] rounded-[4px] outline-none ring-white ring-offset-0',
112-
focusedIndex === index && 'ring-[1.5px]'
113+
(focusedIndex === index ||
114+
(focusedIndex === -1 && hexInput.toLowerCase() === color.toLowerCase())) &&
115+
'ring-[1.5px]'
113116
)}
114117
style={{ backgroundColor: color }}
115118
/>

0 commit comments

Comments
 (0)