@jetbrains/ring-ui-built 6.0.66 → 6.0.67
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.
@@ -56,6 +56,7 @@ export default class Tooltip extends Component<TooltipProps> {
|
|
56
56
|
showPopup: () => void;
|
57
57
|
hidePopup: () => void;
|
58
58
|
addListeners(): void;
|
59
|
+
hideIfMovedOutsidePopup: (ev: React.SyntheticEvent<HTMLElement>) => void;
|
59
60
|
popup?: Popup | null;
|
60
61
|
popupRef: (el: Popup | null) => void;
|
61
62
|
onNestedTooltipShow: () => void;
|
@@ -113,6 +113,13 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
113
113
|
showPopup: false
|
114
114
|
});
|
115
115
|
});
|
116
|
+
_defineProperty(_this, "hideIfMovedOutsidePopup", function (ev) {
|
117
|
+
var _this$popup;
|
118
|
+
if (!('relatedTarget' in ev) || (_this$popup = _this.popup) !== null && _this$popup !== void 0 && (_this$popup = _this$popup.container) !== null && _this$popup !== void 0 && _this$popup.contains(ev.relatedTarget)) {
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
_this.hidePopup();
|
122
|
+
});
|
116
123
|
_defineProperty(_this, "popup", void 0);
|
117
124
|
_defineProperty(_this, "popupRef", function (el) {
|
118
125
|
_this.popup = el;
|
@@ -208,7 +215,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
208
215
|
[modules_cd5e45a9.long]: long
|
209
216
|
}),
|
210
217
|
attached: false,
|
211
|
-
onMouseOut: this.
|
218
|
+
onMouseOut: this.hideIfMovedOutsidePopup,
|
212
219
|
top: 4,
|
213
220
|
dontCloseOnAnchorClick: true,
|
214
221
|
ref: this.popupRef
|