Skip to content

Commit

Permalink
add condition to contextSpace to fix label size
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Nov 11, 2024
1 parent 61d951c commit e9959eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/module/src/components/nodes/labels/NodeLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const NodeLabel: React.FunctionComponent<NodeLabelProps> = ({
const height = Math.max(textSize.height, badgeSize?.height ?? 0) + paddingY * 2;
const iconSpace = labelIconClass || labelIcon ? (height + paddingY * 0.5) / 2 : 0;
const actionSpace = actionIcon && actionSize ? actionSize.width : 0;
const contextSpace = onContextMenu && contextSize ? contextSize.width : 0;
const contextSpace = !hideContextMenuKebab && onContextMenu && contextSize ? contextSize.width : 0;
const primaryWidth = iconSpace + badgeSpace + paddingX + textSize.width + actionSpace + contextSpace + paddingX;
const secondaryWidth = secondaryLabel && secondaryTextSize ? secondaryTextSize.width + 2 * paddingX : 0;
const width = Math.max(primaryWidth, secondaryWidth);
Expand Down Expand Up @@ -185,6 +185,7 @@ const NodeLabel: React.FunctionComponent<NodeLabelProps> = ({
labelIcon,
actionIcon,
actionSize,
hideContextMenuKebab,
onContextMenu,
contextSize,
secondaryLabel,
Expand Down

0 comments on commit e9959eb

Please sign in to comment.