未验证 提交 7e78f249 编写于 作者: S sushuang 提交者: GitHub

Merge pull request #14934 from apache/fix/schedule

fix: error thrown when resize is called after setOption called with lazyUpdate: true. fix #14846, fix #11395 .
...@@ -1160,13 +1160,25 @@ class ECharts extends Eventful<ECEventDefinition> { ...@@ -1160,13 +1160,25 @@ class ECharts extends Eventful<ECEventDefinition> {
return; return;
} }
const optionChanged = ecModel.resetOption('media'); let needPrepare = ecModel.resetOption('media');
const silent = opts && opts.silent; let silent = opts && opts.silent;
// There is some real cases that:
// chart.setOption(option, { lazyUpdate: true });
// chart.resize();
if (this[OPTION_UPDATED_KEY]) {
if (silent == null) {
silent = (this[OPTION_UPDATED_KEY] as any).silent;
}
needPrepare = true;
this[OPTION_UPDATED_KEY] = false;
}
this[IN_MAIN_PROCESS_KEY] = true; this[IN_MAIN_PROCESS_KEY] = true;
optionChanged && prepare(this); needPrepare && prepare(this);
updateMethods.update.call(this, { updateMethods.update.call(this, {
type: 'resize', type: 'resize',
animation: zrUtil.extend({ animation: zrUtil.extend({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册