Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip: The Tooltip component has a memory leak. #5629

Open
ajon88 opened this issue Apr 22, 2024 · 0 comments
Open

Tooltip: The Tooltip component has a memory leak. #5629

ajon88 opened this issue Apr 22, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@ajon88
Copy link

ajon88 commented Apr 22, 2024

Describe the bug

After displaying the tooltip, the resize event was not triggered, causing the window.removeEventListener to not be executed.
The removeEventListener will only execute and release memory altogether after the browser window size changes.

tooltip.js line:190 in tooltipActions()
...
window.addEventListener('resize', function onWindowResize() {
if (!utils.DomHandler.isTouchDevice()) {
$this.hide(el);
}
window.removeEventListener('resize', onWindowResize);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
});

Reproducer

none

PrimeVue version

3.49.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome

Steps to reproduce the behavior

as described

Expected behavior

Execute removeEventListener at the appropriate time to avoid memory leaks.

@ajon88 ajon88 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant