Skip to content

Commit 885dd92

Browse files
committed
[gephi-lite] color picker
Fix #232 Clicking on a color picker should close others -> ranking, it is solved by removing the stopPropagation on the tooltip -> gradient, the solution can't be applied otherwise a new point is created, so just adding a document.body.click() to simulate a click outside Also fix the render of the color picker inside forms (like the edit node modal for eaxample)
1 parent db12a3b commit 885dd92

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const ColorPickerTooltip: FC<{
5454
// prevent thumb creation on track click
5555
e.stopPropagation();
5656
e.preventDefault();
57+
// adding a click on the body to close other already opened color pickers
58+
document.body.click();
5759
// drag stops
5860
setIsDraggingThumb(false);
5961
}}

packages/gephi-lite/src/components/Tooltip.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ const Tooltip = forwardRef<
8181
ref={ref}
8282
onClick={(e) => {
8383
e.preventDefault();
84-
e.stopPropagation();
8584
setShowTooltip("click");
8685
}}
8786
onMouseEnter={() => {

packages/gephi-lite/src/components/data/Attribute.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ export const AttributeEditors: {
291291
<InlineColorPicker color={value} onChange={(v) => onChange(v)} />
292292
</div>
293293
) : (
294-
<ColorPicker clearable color={value} onChange={(v) => onChange(v)} />
294+
<div className="d-flex">
295+
<ColorPicker clearable color={value} onChange={(v) => onChange(v)} />
296+
</div>
295297
);
296298
},
297299
};

0 commit comments

Comments
 (0)