Skip to content

Commit

Permalink
AG-11385 Retrieve the proxyButton datum from the scene node
Browse files Browse the repository at this point in the history
  • Loading branch information
olegat committed May 10, 2024
1 parent 1ac4cc9 commit 6cb689c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ag-charts-community/src/chart/legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ export class Legend extends BaseProperties {
id: `ag-charts-legend-item-${index}`,
textContext: this.getItemAriaText(index),
onclick: (_event: MouseEvent): any => {
const datum = this.data[index];
// Retrieve the datum from the node rather than from the method parameter.
// The method parameter `datum` gets destroyed when the data is refreshed
// using Series.getLegendData(). But the scene node will stay the same.
const datum: CategoryLegendDatum = markerLabel.datum;
this.doClick(datum);
},
});
Expand Down

0 comments on commit 6cb689c

Please sign in to comment.