Skip to content

Commit

Permalink
[EuiPopover] Fix removeEventListener with mismatched capture flag (#5437
Browse files Browse the repository at this point in the history
)

* Fix removeEventListener with mismatched capture flag

Per MDN: 'Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.'

* Add changelog entry
  • Loading branch information
Constance authored Dec 3, 2021
1 parent 7715da3 commit 611a18f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed scrollbars in `EuiRange` tick labels in Safari ([#5427](https://github.com/elastic/eui/pull/5427))
- Fixed an `EuiOverlayMask` bug where it calls window.document on server side([#5422](https://github.com/elastic/eui/pull/5422))
- Fixed unremoved event listener memory leak in `EuiPopover` ([#5436](https://github.com/elastic/eui/pull/5436))

## [`42.0.0`](https://github.com/elastic/eui/tree/v42.0.0)

Expand Down
2 changes: 1 addition & 1 deletion src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class EuiPopover extends Component<Props, State> {
}

componentWillUnmount() {
window.removeEventListener('scroll', this.positionPopoverFixed);
window.removeEventListener('scroll', this.positionPopoverFixed, true);
clearTimeout(this.respositionTimeout);
clearTimeout(this.closingTransitionTimeout);
cancelAnimationFrame(this.closingTransitionAnimationFrame!);
Expand Down

0 comments on commit 611a18f

Please sign in to comment.