Skip to content

Commit

Permalink
feat: empty values for color attribute show swatch when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson committed May 20, 2024
1 parent 2d4102a commit 4faeb08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions v3/src/components/case-table/case-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ $table-body-font-size: 8pt;
.cell-edit-color-swatch-interior {
width: 100%;
height: 100%;
border: 1px solid gray;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/case-table/color-cell-text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function ColorCellTextEditor({ row, column, onRowChange, onClose
const color = supportColors && inputValue ? parseColor(inputValue, { colorNames }) : undefined
const hexColor = color ? parseColorToHex(color, { colorNames }) : undefined
// show the color swatch if the initial value appears to be a color (no change mid-edit)
const showColorSwatch = useRef(!!hexColor)
const showColorSwatch = useRef(!!hexColor || attribute?.userType === "color")

useEffect(() => {
selectAllCases(data, false)
Expand Down

0 comments on commit 4faeb08

Please sign in to comment.