@clayui/tooltip
Advanced tools
Comparing version 3.78.2 to 3.78.3
@@ -57,4 +57,4 @@ "use strict"; | ||
floating: false, | ||
message: '', | ||
setAsHTML: false | ||
setAsHTML: false, | ||
title: '' | ||
}; | ||
@@ -102,5 +102,5 @@ var TRIGGER_HIDE_EVENTS = ['dragstart', 'mouseout', 'mouseup', 'pointerup', 'touchend']; | ||
floating = _useReducer2$.floating, | ||
_useReducer2$$message = _useReducer2$.message, | ||
message = _useReducer2$$message === void 0 ? '' : _useReducer2$$message, | ||
setAsHTML = _useReducer2$.setAsHTML, | ||
_useReducer2$$title = _useReducer2$.title, | ||
title = _useReducer2$$title === void 0 ? '' : _useReducer2$$title, | ||
dispatch = _useReducer2[1]; | ||
@@ -156,3 +156,4 @@ | ||
sourceElement: tooltipRef, | ||
targetElement: titleNode | ||
targetElement: titleNode, | ||
title: title | ||
}); | ||
@@ -169,4 +170,4 @@ var onShow = (0, _react.useCallback)(function (event) { | ||
floating: _props.floating, | ||
message: _props.title, | ||
setAsHTML: _props.setAsHTML, | ||
title: _props.title, | ||
type: 'update' | ||
@@ -250,3 +251,3 @@ }); | ||
targetNode: target.current, | ||
title: message | ||
title: title | ||
}); | ||
@@ -253,0 +254,0 @@ |
@@ -16,4 +16,5 @@ /** | ||
targetElement: React.MutableRefObject<HTMLElement | null>; | ||
title: string; | ||
}; | ||
export declare function useAlign({ align, autoAlign, floating, isOpen, onAlign, sourceElement, targetElement, }: Props): void; | ||
export declare function useAlign({ align, autoAlign, floating, isOpen, onAlign, sourceElement, targetElement, title, }: Props): void; | ||
export {}; |
@@ -80,3 +80,4 @@ "use strict"; | ||
sourceElement = _ref.sourceElement, | ||
targetElement = _ref.targetElement; | ||
targetElement = _ref.targetElement, | ||
title = _ref.title; | ||
var mousePosition = (0, _shared.useMousePosition)(20); | ||
@@ -101,3 +102,3 @@ (0, _react.useEffect)(function () { | ||
(0, _react.useEffect)(function () { | ||
if (targetElement.current && sourceElement.current && !floating) { | ||
if (targetElement.current && sourceElement.current && isOpen && !floating) { | ||
var points = ALIGNMENTS_MAP[align || 'top']; | ||
@@ -122,3 +123,3 @@ var alignment = (0, _shared.doAlign)({ | ||
} | ||
}, [align, isOpen]); | ||
}, [align, title, isOpen]); | ||
} |
{ | ||
"name": "@clayui/tooltip", | ||
"version": "3.78.2", | ||
"version": "3.78.3", | ||
"description": "ClayTooltip component", | ||
@@ -29,3 +29,3 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@clayui/shared": "^3.78.2", | ||
"@clayui/shared": "^3.78.3", | ||
"classnames": "^2.2.6", | ||
@@ -43,3 +43,3 @@ "dom-align": "^1.12.2", | ||
], | ||
"gitHead": "7322366140891124565709ce33e4b0085012c410" | ||
"gitHead": "6066b46f9b7e7455603e9f02e9ebc4f792a619e1" | ||
} |
@@ -75,2 +75,3 @@ /** | ||
targetElement: React.MutableRefObject<HTMLElement | null>; | ||
title: string; | ||
}; | ||
@@ -86,2 +87,3 @@ | ||
targetElement, | ||
title, | ||
}: Props) { | ||
@@ -113,3 +115,8 @@ const mousePosition = useMousePosition(20); | ||
useEffect(() => { | ||
if (targetElement.current && sourceElement.current && !floating) { | ||
if ( | ||
targetElement.current && | ||
sourceElement.current && | ||
isOpen && | ||
!floating | ||
) { | ||
const points = ALIGNMENTS_MAP[align || 'top'] as [string, string]; | ||
@@ -139,3 +146,3 @@ | ||
} | ||
}, [align, isOpen]); | ||
}, [align, title, isOpen]); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52348
1377
Updated@clayui/shared@^3.78.3