Skip to content

Commit eab9233

Browse files
authored
Fix the mis-highlighting in flamegraphs (#6351)
1 parent 2f97323 commit eab9233

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ui/packages/shared/profile/src/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,16 @@ export const FlameNode = React.memo(
144144

145145
// Memoize hovering name lookup
146146
const hoveringName = useMemo(() => {
147-
return hoveringRow !== undefined ? arrowToString(columns.functionName?.get(hoveringRow)) : '';
147+
return hoveringRow !== undefined
148+
? arrowToString(columns.functionName?.get(hoveringRow))
149+
: null;
148150
}, [columns.functionName, hoveringRow]);
149151

150152
const shouldBeHighlighted =
151-
functionName != null && hoveringName != null && functionName === hoveringName;
153+
hoveringRow !== undefined &&
154+
functionName != null &&
155+
hoveringName != null &&
156+
functionName === hoveringName;
152157

153158
const colorResult = useNodeColor({
154159
isDarkMode: darkMode,

0 commit comments

Comments
 (0)