Browse Source

chore: move order

DaiQiangReal 1 year ago
parent
commit
7193d2f006
1 changed files with 11 additions and 11 deletions
  1. 11 11
      packages/semi-foundation/tooltip/foundation.ts

+ 11 - 11
packages/semi-foundation/tooltip/foundation.ts

@@ -314,6 +314,17 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
         const content = this.getProp('content');
         const trigger = this.getProp('trigger');
 
+        const clickTriggerToHide = this.getProp('clickTriggerToHide');
+        const { visible, displayNone } = this.getStates();
+        if (displayNone) {
+            this.setDisplayNone(false);
+        } 
+        if (visible) {
+            return ;
+        }
+
+        this.clearDelayTimer();
+
         /**
          * If you emit an event in setState callback, you need to place the event listener function before setState to execute.
          * This is to avoid event registration being executed later than setState callback when setState is executed in setTimeout.
@@ -333,17 +344,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
             };
             this._adapter.on('portalInserted', checkTriggerIsHover);
         }
-        const clickTriggerToHide = this.getProp('clickTriggerToHide');
-        const { visible, displayNone } = this.getStates();
-        if (displayNone) {
-            this.setDisplayNone(false);
-        } 
-        if (visible) {
-            return ;
-        }
-
-        this.clearDelayTimer();
-
 
 
         this._adapter.on('positionUpdated', () => {