Skip to content

Commit f5cd542

Browse files
committed
[appearance] selected color item when 'fixed'
Fix #193
1 parent fe29977 commit f5cd542

File tree

1 file changed

+6
-3
lines changed
  • packages/gephi-lite/src/components/GraphAppearance/color

1 file changed

+6
-3
lines changed

packages/gephi-lite/src/components/GraphAppearance/color/ColorItem.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ export const ColorItem: FC<{ itemType: ItemType }> = ({ itemType }) => {
9393
];
9494
}, [edgeFields, itemType, nodeFields, dynamicNodeFields, dynamicEdgeFields, t]);
9595
const selectedOption =
96-
options.find(
97-
(option) => option.type === color.type && option.field && color.field && option.field.field === color.field.field,
98-
) || options[0];
96+
options.find((option) => {
97+
if (!color.field) {
98+
return color.type === option.type;
99+
}
100+
return option.type === color.type && option.field && color.field && option.field.field === color.field.field;
101+
}) || options[0];
99102

100103
return (
101104
<div className="panel-block">

0 commit comments

Comments
 (0)