Skip to content

Commit

Permalink
Merge pull request #266 from nimaadarga/feat/context-menu-from-edge-l…
Browse files Browse the repository at this point in the history
…abels

feat: open edge context menu from label click
  • Loading branch information
amcdnl authored Aug 27, 2024
2 parents 6ffa9f0 + f3e7b25 commit bd23e1a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/symbols/Edge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,17 @@ export const Edge: FC<EdgeProps> = ({
() =>
labelVisible &&
label && (
<a.group position={labelPosition as any}>
<a.group
position={labelPosition as any}
onContextMenu={() => {
if (!disabled) {
setMenuVisible(true);
onContextMenu?.(edge);
}
}}
onPointerOver={pointerOver}
onPointerOut={pointerOut}
>
<Label
text={label}
ellipsis={15}
Expand All @@ -336,13 +346,18 @@ export const Edge: FC<EdgeProps> = ({
),
[
active,
disabled,
edge,
isActive,
isSelected,
label,
labelFontUrl,
labelPosition,
labelRotation,
labelVisible,
onContextMenu,
pointerOut,
pointerOver,
selectionOpacity,
theme.edge.label.activeColor,
theme.edge.label.color,
Expand Down

0 comments on commit bd23e1a

Please sign in to comment.