@douyinfe/semi-foundation 2.61.0-beta.0 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,16 +62,6 @@ class Tooltip extends _foundation.default {
62
62
  this.show = () => {
63
63
  const content = this.getProp('content');
64
64
  const trigger = this.getProp('trigger');
65
- if (trigger === "hover") {
66
- const checkTriggerIsHover = () => {
67
- const triggerDOM = this._adapter.getTriggerDOM();
68
- if (trigger && !triggerDOM.matches(":hover")) {
69
- this.hide();
70
- }
71
- this._adapter.off("portalInserted", checkTriggerIsHover);
72
- };
73
- this._adapter.on('portalInserted', checkTriggerIsHover);
74
- }
75
65
  const clickTriggerToHide = this.getProp('clickTriggerToHide');
76
66
  const {
77
67
  visible,
@@ -92,6 +82,16 @@ class Tooltip extends _foundation.default {
92
82
  this._adapter.on('portalInserted', () => {
93
83
  this.calcPosition();
94
84
  });
85
+ if (trigger === "hover") {
86
+ const checkTriggerIsHover = () => {
87
+ const triggerDOM = this._adapter.getTriggerDOM();
88
+ if (trigger && !triggerDOM.matches(":hover")) {
89
+ this.hide();
90
+ }
91
+ this._adapter.off("portalInserted", checkTriggerIsHover);
92
+ };
93
+ this._adapter.on('portalInserted', checkTriggerIsHover);
94
+ }
95
95
  this._adapter.on('positionUpdated', () => {
96
96
  this._togglePortalVisible(true);
97
97
  });
@@ -55,16 +55,6 @@ export default class Tooltip extends BaseFoundation {
55
55
  this.show = () => {
56
56
  const content = this.getProp('content');
57
57
  const trigger = this.getProp('trigger');
58
- if (trigger === "hover") {
59
- const checkTriggerIsHover = () => {
60
- const triggerDOM = this._adapter.getTriggerDOM();
61
- if (trigger && !triggerDOM.matches(":hover")) {
62
- this.hide();
63
- }
64
- this._adapter.off("portalInserted", checkTriggerIsHover);
65
- };
66
- this._adapter.on('portalInserted', checkTriggerIsHover);
67
- }
68
58
  const clickTriggerToHide = this.getProp('clickTriggerToHide');
69
59
  const {
70
60
  visible,
@@ -85,6 +75,16 @@ export default class Tooltip extends BaseFoundation {
85
75
  this._adapter.on('portalInserted', () => {
86
76
  this.calcPosition();
87
77
  });
78
+ if (trigger === "hover") {
79
+ const checkTriggerIsHover = () => {
80
+ const triggerDOM = this._adapter.getTriggerDOM();
81
+ if (trigger && !triggerDOM.matches(":hover")) {
82
+ this.hide();
83
+ }
84
+ this._adapter.off("portalInserted", checkTriggerIsHover);
85
+ };
86
+ this._adapter.on('portalInserted', checkTriggerIsHover);
87
+ }
88
88
  this._adapter.on('positionUpdated', () => {
89
89
  this._togglePortalVisible(true);
90
90
  });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.61.0-beta.0",
3
+ "version": "2.61.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.61.0-beta.0",
10
+ "@douyinfe/semi-animation": "2.61.0",
11
11
  "async-validator": "^3.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "date-fns": "^2.29.3",
@@ -24,7 +24,7 @@
24
24
  "*.scss",
25
25
  "*.css"
26
26
  ],
27
- "gitHead": "dc543a10bb997bbff4d0a98268a4a1de6b3f31ca",
27
+ "gitHead": "8f2bdc04e4622628802f4e4469446ca275ebba8f",
28
28
  "devDependencies": {
29
29
  "@babel/plugin-transform-runtime": "^7.15.8",
30
30
  "@babel/preset-env": "^7.15.8",
@@ -313,16 +313,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
313
313
  show = () => {
314
314
  const content = this.getProp('content');
315
315
  const trigger = this.getProp('trigger');
316
- if (trigger==="hover") {
317
- const checkTriggerIsHover = () => {
318
- const triggerDOM = this._adapter.getTriggerDOM();
319
- if (trigger && !triggerDOM.matches(":hover")) {
320
- this.hide();
321
- }
322
- this._adapter.off("portalInserted", checkTriggerIsHover);
323
- };
324
- this._adapter.on('portalInserted', checkTriggerIsHover);
325
- }
316
+
326
317
  const clickTriggerToHide = this.getProp('clickTriggerToHide');
327
318
  const { visible, displayNone } = this.getStates();
328
319
  if (displayNone) {
@@ -343,6 +334,18 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
343
334
  this.calcPosition();
344
335
  });
345
336
 
337
+ if (trigger==="hover") {
338
+ const checkTriggerIsHover = () => {
339
+ const triggerDOM = this._adapter.getTriggerDOM();
340
+ if (trigger && !triggerDOM.matches(":hover")) {
341
+ this.hide();
342
+ }
343
+ this._adapter.off("portalInserted", checkTriggerIsHover);
344
+ };
345
+ this._adapter.on('portalInserted', checkTriggerIsHover);
346
+ }
347
+
348
+
346
349
  this._adapter.on('positionUpdated', () => {
347
350
  this._togglePortalVisible(true);
348
351
  });