ElemeFE / ElemeFE/element-react

Memory Leak With Popover Component

Open
#926 1 comment 3 reactions 1 assignee Claimed by @loadchange View on GitHub
Dominant language
JavaScript
Stars
2.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

### Description

On popover unmount, the state is being changed resulting in a memory leak warning.

### Reproduce Steps

We ran into it when the unmount lifecycle event fires, while simultaneously clicking a button (example: clicking a cancel button).

### Error Trace (if possible)

![image](https://user-images.githubusercontent.com/14169654/52231734-f0f02500-2877-11e9-9cfe-02da938a0896.png)

### Solution

Fix: there is a click event attached to the document that closes the popover if clicking outside of the popover. This logic needs to be handled differently.

### Additional Information

Like I said earlier: This occurs when clicking anywhere on the document while the popover component is/did unmount.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.