pissang commented on a change in pull request #12561: URL: https://github.com/apache/incubator-echarts/pull/12561#discussion_r464363470
########## File path: src/component/toolbox/feature/DataView.js ########## @@ -426,13 +432,18 @@ function tryMergeDataOption(newData, originalData) { return zrUtil.map(newData, function (newVal, idx) { var original = originalData && originalData[idx]; if (zrUtil.isObject(original) && !zrUtil.isArray(original)) { - if (zrUtil.isObject(newVal) && !zrUtil.isArray(newVal)) { - newVal = newVal.value; + var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal); + if (!newValIsObject) { + newVal = { + value: newVal + }; + } + // original data has name but new data has no name + if (original.name != null && newVal.name == null) { + delete original.name; } // Original data has option Review comment: Should not modify the original data. It's better to delete the name in newVal after `defaults` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org