Skip to content

Commit

Permalink
chore: move order
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiQiangReal committed Jun 20, 2024
1 parent 4483cc3 commit 7193d2f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/semi-foundation/tooltip/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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', () => {
Expand Down

0 comments on commit 7193d2f

Please sign in to comment.