Skip to content

FocusZone: reduce global event listeners#8421

Merged
dzearing merged 4 commits intomicrosoft:masterfrom
dzearing:focuszone-perf-tweak
Mar 22, 2019
Merged

FocusZone: reduce global event listeners#8421
dzearing merged 4 commits intomicrosoft:masterfrom
dzearing:focuszone-perf-tweak

Conversation

@dzearing
Copy link
Member

@dzearing dzearing commented Mar 21, 2019

When a FocusZone is hosted, each outer zone creates a captured event listener for keydown presses, to adjust tab indexes when tab is pressed.

This change reduces the listeners down to a single listener, therefore reducing the work being done when typing characters.

There should be no changes in behavior here; just less work being done when keydowns occur.

This was requested as a performance optimization from Outlook. Happy to help.

Microsoft Reviewers: Open in CodeFlow

Copy link
Member

@JasonGore JasonGore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _isInnerZone value only seems to apply to immediate parent and not any other FocusZone parents further up. Are FocusZone parents further up another scenario that should be considered?

direction: FocusZoneDirection.bidirectional
};

private static _allFocusZones = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@size-auditor
Copy link

size-auditor bot commented Mar 22, 2019

Bundle test Size (minified) Diff from master
CommandBar 180.379 kB ExceedsBaseline     126 bytes
SelectedItemsList 204.62 kB ExceedsBaseline     126 bytes
Panel 178.311 kB ExceedsBaseline     126 bytes
Nav 169.955 kB ExceedsBaseline     126 bytes
Dialog 179.767 kB ExceedsBaseline     126 bytes
DetailsList 209.067 kB ExceedsBaseline     126 bytes
Pickers 253.344 kB ExceedsBaseline     126 bytes
Pivot 168.497 kB ExceedsBaseline     126 bytes
DatePicker 199.427 kB ExceedsBaseline     126 bytes
ContextualMenu 144.492 kB ExceedsBaseline     126 bytes
Dropdown 205.647 kB ExceedsBaseline     126 bytes
Rating 82.198 kB ExceedsBaseline     126 bytes
ComboBox 217.916 kB ExceedsBaseline     126 bytes
MessageBar 170.222 kB ExceedsBaseline     126 bytes
SearchBox 167.266 kB ExceedsBaseline     126 bytes
ExtendedPicker 85.225 kB ExceedsBaseline     126 bytes
DocumentCard 192.252 kB ExceedsBaseline     126 bytes
OverflowSet 55.238 kB ExceedsBaseline     126 bytes
Facepile 188.727 kB ExceedsBaseline     126 bytes
ShimmeredDetailsList 219.889 kB ExceedsBaseline     126 bytes
FloatingPicker 215.098 kB ExceedsBaseline     126 bytes
SpinButton 173.551 kB ExceedsBaseline     126 bytes
FocusZone 28.905 kB ExceedsBaseline     126 bytes
Calendar 143.504 kB ExceedsBaseline     126 bytes
SwatchColorPicker 176.548 kB ExceedsBaseline     126 bytes
TeachingBubble 174.977 kB ExceedsBaseline     126 bytes
Button 172.583 kB ExceedsBaseline     126 bytes
Breadcrumb 178.852 kB ExceedsBaseline     126 bytes
Grid 163.619 kB ExceedsBaseline     126 bytes
GroupedList 118.988 kB ExceedsBaseline     126 bytes

ExceedsTolerance  Exceeds Tolerance     ExceedsBaseline  Exceeds Baseline     BelowBaseline  Below Baseline     1 kB = 1000 bytes

@dzearing dzearing merged commit 2e3ed4f into microsoft:master Mar 22, 2019
@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v6.159.0 has been released which incorporates this pull request.:tada:

Handy links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants