Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### BREAKING CHANGES
- Add `@fluentui/styles` package for all styles' related utilities and TS types @layershifter, @mnajdova ([#2222](https://github.com/microsoft/fluent-ui-react/pull/2222))

### Fixes
- Fix event lister leak in `FocusZone` @miroslavstastny ([#2227](https://github.com/microsoft/fluent-ui-react/pull/2227))

<!--------------------------------[ v0.43.0 ]------------------------------- -->
## [v0.43.0](https://github.com/microsoft/fluent-ui-react/tree/v0.43.0) (2020-01-08)
[Compare changes](https://github.com/microsoft/fluent-ui-react/compare/v0.42.0..v0.43.0)
Expand Down
12 changes: 6 additions & 6 deletions packages/react-bindings/src/FocusZone/FocusZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export default class FocusZone extends React.Component<FocusZoneProps> implement

if (!this._isInnerZone) {
_outerZones.add(this)
}

if (this.windowElement && _outerZones.size === 1) {
this.windowElement.addEventListener('keydown', this._onKeyDownCapture, true)
if (this.windowElement && _outerZones.size === 1) {
this.windowElement.addEventListener('keydown', this._onKeyDownCapture, true)
}
}

this._root.current.addEventListener('blur', this._onBlur, true)
Expand Down Expand Up @@ -197,10 +197,10 @@ export default class FocusZone extends React.Component<FocusZoneProps> implement

if (!this._isInnerZone) {
_outerZones.delete(this)
}

if (this.windowElement && _outerZones.size === 0) {
this.windowElement.removeEventListener('keydown', this._onKeyDownCapture, true)
if (this.windowElement && _outerZones.size === 0) {
this.windowElement.removeEventListener('keydown', this._onKeyDownCapture, true)
}
}

if (this._root.current) {
Expand Down