Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(FocusZone): Event listener leak in inner FZ #2227

Merged
merged 4 commits into from
Jan 12, 2020

Conversation

miroslavstastny
Copy link
Member

Fixes #2219.

Only the first outer zone is supposed to attach keydown event listener to window.

Previously, FocusZone always added the listener when there was exactly one outer zone. That did not match the removeEventListener logic in componentWillUnmount introduced in #2056.

@DustyTheBot
Copy link
Collaborator

DustyTheBot commented Jan 10, 2020

Perf comparison

Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.61 0.37 1.65:1 2000 1224
🔧 Button.Fluent 1.29 0.17 7.59:1 1000 1285
🔧 Checkbox.Fluent 1.41 0.29 4.86:1 1000 1408
🔧 Dialog.Fluent 0.33 0.17 1.94:1 5000 1654
🔧 Dropdown.Fluent 3.61 0.38 9.5:1 1000 3614
🔧 Icon.Fluent 0.25 0.03 8.33:1 5000 1271
🔧 Image.Fluent 0.11 0.08 1.38:1 5000 550
🔧 Slider.Fluent 2.23 0.32 6.97:1 1000 2228
🦄 Text.Fluent 0.07 0.18 0.39:1 5000 325
🦄 Tooltip.Fluent 0.4 18.97 0.02:1 5000 2024

🔧 Needs work     🎯 On target     🦄 Amazing

Generated by 🚫 dangerJS

@dzearing dzearing merged commit 21c64fa into master Jan 12, 2020
@dzearing dzearing deleted the fix/inner-focus-zone-event-listener-leak branch January 12, 2020 17:50
miroslavstastny added a commit that referenced this pull request Jan 17, 2020
* fix(FocusZone): Event listener leak in inner FZ

* - remove event listener only when unmounting (the last) outer zone

* - changelog
miroslavstastny added a commit that referenced this pull request Jan 30, 2020
* fix(FocusZone): Event listener leak in inner FZ

* - remove event listener only when unmounting (the last) outer zone

* - changelog

(cherry picked from commit 21c64fa)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak: Chat message component is leaking menus when submenu is opened and closed
3 participants