susiwen8 commented on a change in pull request #15534:
URL: https://github.com/apache/echarts/pull/15534#discussion_r780674516
##########
File path: src/model/Series.ts
##########
@@ -588,18 +604,33 @@ class SeriesModel<Opt extends SeriesOption =
SeriesOption> extends ComponentMode
return;
}
- if (selectedMode === 'multiple') {
- const selectedMap = this.option.selectedMap ||
(this.option.selectedMap = {});
+ if (selectedMode === 'series') {
+ this.option.selectedMap = 'all';
+ }
+ else if (selectedMode === 'multiple') {
+ if (isString(this.option.selectedMap)) {
+ this.option.selectedMap = {};
+ }
+ const selectedMap = (this.option.selectedMap ||
(this.option.selectedMap = {}));
for (let i = 0; i < len; i++) {
const dataIndex = innerDataIndices[i];
+ if ((data.getItemModel(dataIndex) as Model).get(['select',
'disabled']) === true) {
+ return;
+ }
// TODO diffrent types of data share same object.
const nameOrId = getSelectionKey(data, dataIndex);
selectedMap[nameOrId] = true;
this._selectedDataIndicesMap[nameOrId] =
data.getRawIndex(dataIndex);
}
}
else if (selectedMode === 'single' || selectedMode === true) {
+ if (isString(this.option.selectedMap)) {
Review comment:
Yes, It is, cause user may update `selectedMode` from `series` to
`single`. I will add a test case for it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]