Skip to content

Commit

Permalink
fix(legend): use eachComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
plainheart committed Jul 8, 2024
1 parent 5c84ce2 commit c5ff583
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/component/legend/legendAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function legendSelectActionHandler(methodName: LegendSelectMethodNames, payload:
const selectedMap: Record<string, boolean> = {};
const isToggleSelect = methodName === 'toggleSelected';
let isSelected: boolean;
const legendModels = ecModel.findComponents({ mainType: 'legend', query: payload }) as LegendModel[];
each(legendModels, function (legendModel: LegendModel) {
ecModel.eachComponent({ mainType: 'legend', query: payload }, function (legendModel: LegendModel) {
if (isToggleSelect && isSelected != null) {
// Force other legend has same selected status
// Or the first is toggled to true and other are toggled to false
Expand Down Expand Up @@ -65,7 +64,6 @@ function legendSelectActionHandler(methodName: LegendSelectMethodNames, payload:
}
});
});

// Return the event explicitly
return (methodName === 'allSelect' || methodName === 'inverseSelect')
? {
Expand Down

0 comments on commit c5ff583

Please sign in to comment.