Skip to content

Commit ed918fa

Browse files
author
Emrah Soytekin
committed
fix: add highlight status to key
1 parent fe10f90 commit ed918fa

File tree

1 file changed

+5
-1
lines changed
  • src/internal/components/series-details

1 file changed

+5
-1
lines changed

src/internal/components/series-details/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ function ChartSeriesDetails(
6969
<ul className={clsx(styles.list, compactList && styles.compact)}>
7070
{details.map(({ key, value, marker, isDimmed, subItems, expandableId, description, highlighted }, index) => (
7171
<li
72-
key={[index, highlighted].join(",")}
72+
// Include 'highlighted' in the key to force React re-render when highlight state changes.
73+
// Without this, the highlight indicator div may not be removed when cursor moves away from data points
74+
// due to React's reconciliation algorithm not detecting the state change in complex data scenarios.
75+
// This ensures proper cleanup of visual highlight indicators.
76+
key={[index, highlighted].join("-")}
7377
className={clsx({
7478
[styles.dimmed]: isDimmed,
7579
[styles["list-item"]]: true,

0 commit comments

Comments
 (0)