You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/06/09 08:33:01 UTC

[incubator-echarts] branch label-enhancement updated: fix(state): forget to remove saved states in clearStates.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch label-enhancement
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/label-enhancement by this push:
     new a2645c1  fix(state): forget to remove saved states in clearStates.
a2645c1 is described below

commit a2645c1b4186e6d13bff7a81d6d2beaa6c292cb7
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Jun 9 16:32:42 2020 +0800

    fix(state): forget to remove saved states in clearStates.
---
 src/echarts.ts | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/echarts.ts b/src/echarts.ts
index 393808c..3efed0c 100644
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@ -1836,19 +1836,23 @@ class ECharts extends Eventful {
                 // TODO If el is incremental.
                 if (el.hasState()) {
                     (el as DisplayableWithStatesHistory).__prevStates = el.currentStates;
-                    const textContent = el.getTextContent();
-                    const textGuide = el.getTextGuideLine();
-                    if (el.stateTransition) {
-                        el.stateTransition = null;
-                    }
-                    if (textContent && textContent.stateTransition) {
-                        textContent.stateTransition = null;
-                    }
-                    if (textGuide && textGuide.stateTransition) {
-                        textGuide.stateTransition = null;
-                    }
                     el.clearStates();
                 }
+                else if ((el as DisplayableWithStatesHistory).__prevStates) {
+                    (el as DisplayableWithStatesHistory).__prevStates = null;
+                }
+
+                const textContent = el.getTextContent();
+                const textGuide = el.getTextGuideLine();
+                if (el.stateTransition) {
+                    el.stateTransition = null;
+                }
+                if (textContent && textContent.stateTransition) {
+                    textContent.stateTransition = null;
+                }
+                if (textGuide && textGuide.stateTransition) {
+                    textGuide.stateTransition = null;
+                }
             });
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org