New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/tooltip

Package Overview
Dependencies
Maintainers
1
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/tooltip - npm Package Compare versions

Comparing version 12.1.13 to 12.1.14

5

CHANGELOG.md
# @atlaskit/tooltip
## 12.1.14
- [patch] [8f179c4](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8f179c4):
- Remove scroll listener in componentWillMount in Tooltip to fix potential memory leak from 'close' tooltip not properly unmounting when hiding Examples modal via the X button
## 12.1.13

@@ -4,0 +9,0 @@ - Updated dependencies [58b84fa](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/58b84fa):

20

dist/cjs/components/Tooltip.js

@@ -51,2 +51,7 @@ "use strict";

/* eslint-disable react/require-default-props */
var SCROLL_OPTIONS = {
capture: true,
passive: true
};
function getMousePosition(mouseCoordinates) {

@@ -205,2 +210,3 @@ var safeMouse = mouseCoordinates || {

this.cancelPendingSetState();
this.removeScrollListener();
}

@@ -210,16 +216,16 @@ }, {

value: function componentDidUpdate(prevProps, prevState) {
var scrollOptions = {
capture: true,
passive: true
};
if (!prevState.isVisible && this.state.isVisible) {
if (this.props.onShow) this.props.onShow();
window.addEventListener('scroll', this.handleWindowScroll, scrollOptions);
window.addEventListener('scroll', this.handleWindowScroll, SCROLL_OPTIONS);
} else if (prevState.isVisible && !this.state.isVisible) {
if (this.props.onHide) this.props.onHide();
window.removeEventListener('scroll', this.handleWindowScroll, scrollOptions);
this.removeScrollListener();
}
}
}, {
key: "removeScrollListener",
value: function removeScrollListener() {
window.removeEventListener('scroll', this.handleWindowScroll, SCROLL_OPTIONS);
}
}, {
key: "render",

@@ -226,0 +232,0 @@ value: function render() {

@@ -22,2 +22,6 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread";

import { hoveredPayload, unhoveredPayload } from './utils/analytics-payloads';
var SCROLL_OPTIONS = {
capture: true,
passive: true
};

@@ -189,2 +193,3 @@ function getMousePosition(mouseCoordinates) {

this.cancelPendingSetState();
this.removeScrollListener();
}

@@ -194,16 +199,16 @@ }, {

value: function componentDidUpdate(prevProps, prevState) {
var scrollOptions = {
capture: true,
passive: true
};
if (!prevState.isVisible && this.state.isVisible) {
if (this.props.onShow) this.props.onShow();
window.addEventListener('scroll', this.handleWindowScroll, scrollOptions);
window.addEventListener('scroll', this.handleWindowScroll, SCROLL_OPTIONS);
} else if (prevState.isVisible && !this.state.isVisible) {
if (this.props.onHide) this.props.onHide();
window.removeEventListener('scroll', this.handleWindowScroll, scrollOptions);
this.removeScrollListener();
}
}
}, {
key: "removeScrollListener",
value: function removeScrollListener() {
window.removeEventListener('scroll', this.handleWindowScroll, SCROLL_OPTIONS);
}
}, {
key: "render",

@@ -210,0 +215,0 @@ value: function render() {

{
"name": "@atlaskit/tooltip",
"version": "12.1.13",
"version": "12.1.14",
"sideEffects": false
}
{
"name": "@atlaskit/tooltip",
"version": "12.1.13",
"version": "12.1.14",
"description": "A React Component for displaying Tooltips",

@@ -41,2 +41,3 @@ "license": "Apache-2.0",

"@atlaskit/icon": "^15.0.2",
"@atlaskit/visual-regression": "^0.0.1",
"enzyme": "^3.7.0",

@@ -50,2 +51,2 @@ "react-dom": "^16.4.2"

]
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc