Browse Source

fix: fix triggerDOM may not defined oncall 5353541

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

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

@@ -337,7 +337,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
         if (trigger==="hover") {
         if (trigger==="hover") {
             const checkTriggerIsHover = () => {
             const checkTriggerIsHover = () => {
                 const triggerDOM = this._adapter.getTriggerDOM();
                 const triggerDOM = this._adapter.getTriggerDOM();
-                if (trigger && !triggerDOM.matches(":hover")) {
+                if (trigger && !triggerDOM?.matches?.(":hover")) {
                     this.hide();
                     this.hide();
                 }
                 }
                 this._adapter.off("portalInserted", checkTriggerIsHover);
                 this._adapter.off("portalInserted", checkTriggerIsHover);