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

Commit

Permalink
fix(FocusTrapZone): Port FocusTrapZone leak fix from Fabric (#2270)
Browse files Browse the repository at this point in the history
port FocusTrapZone leak fix from Fabric

(cherry picked from commit 9f69c93)
  • Loading branch information
jurokapsiar authored and miroslavstastny committed Jan 31, 2020
1 parent 59e1684 commit 67137b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-bindings/src/FocusZone/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This is a list of changes made to this Stardust copy of FocusZone in comparison
- `FocusZone` should respect elements with `contenteditable` attribute on Home/End key press @sophieH29 ([#1749](https://github.com/stardust-ui/react/pull/1749))
- Fix bidirectional `FocusZone` to land focus correctly on DOWN key press after series of UP arrow keys @sophieH29 ([#1794](https://github.com/stardust-ui/react/pull/1794))
- Use always `getDocument` to correctly define current document object @sophieH29 ([#1820](https://github.com/stardust-ui/react/pull/1820))
- Fix element reference memory leaks - Fabric PR 11618 @jurokapsiar ([#2270](https://github.com/microsoft/fluent-ui-react/pull/2270))

### Features
- Add embed mode for FocusZone and new Chat behavior ([#233](https://github.com/stardust-ui/react/pull/233))
Expand Down
4 changes: 4 additions & 0 deletions packages/react-bindings/src/FocusZone/FocusTrapZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ export default class FocusTrapZone extends React.Component<FocusTrapZoneProps, {
) {
this._releaseFocusTrapZone()
}

// Dispose of element references so the DOM Nodes can be garbage-collected
delete this._previouslyFocusedElementInTrapZone
delete this._previouslyFocusedElementOutsideTrapZone
}

render(): JSX.Element {
Expand Down

0 comments on commit 67137b4

Please sign in to comment.