Skip to content

FocusTrapZone: Add new disabled prop and use in FocusTrapCallout#8809

Merged
JasonGore merged 8 commits intomicrosoft:masterfrom
JasonGore:jg/ftz-disabled-prop
Apr 24, 2019
Merged

FocusTrapZone: Add new disabled prop and use in FocusTrapCallout#8809
JasonGore merged 8 commits intomicrosoft:masterfrom
JasonGore:jg/ftz-disabled-prop

Conversation

@JasonGore
Copy link
Member

@JasonGore JasonGore commented Apr 22, 2019

Pull request checklist

Description of changes

#8552 highlighted a need to add a disabled prop to FocusTrapZone to allow FocusTrapZone to be present in the hierarchy in performant scenarios while being disabled. FocusZone already has a disabled prop so this also brings FocusTrapZone in parity.

Also modifies all FocusTrapZone examples to render all the time and make use of new disabled prop.

FocusTrapCallout was also modified to make use of this new prop and resolves #8552.

Focus areas to test

Add tests to test disabled scenarios.

Microsoft Reviewers: Open in CodeFlow

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Apr 22, 2019

Component perf results:

Scenario Target branch avg total (ms) PR avg total (ms) Target branch avg per item (ms) PR avg per item (ms)
PrimaryButton 104.367 105.297 1.044 1.053
BaseButton 36.642 39.048 0.366 0.390
NewButton 114.622 115.737 1.146 1.157
button 5.517 5.720 0.055 0.057
DetailsRows without styles 196.924 193.828 1.969 1.938
DetailsRows 215.996 214.599 2.160 2.146
Toggles 51.429 54.007 0.514 0.540
NewToggle 72.865 73.561 0.729 0.736

@size-auditor
Copy link

size-auditor bot commented Apr 22, 2019

Bundle test Size (minified) Diff from master
Callout 83.226 kB ExceedsBaseline     269 bytes
HoverCard 98.882 kB ExceedsBaseline     269 bytes
Panel 182.834 kB ExceedsBaseline     252 bytes
Dialog 185.129 kB ExceedsBaseline     252 bytes
DatePicker 203.191 kB ExceedsBaseline     252 bytes
Modal 79.079 kB ExceedsBaseline     252 bytes
FocusTrapZone 17.487 kB ExceedsBaseline     252 bytes
Dropdown 213.808 kB ExceedsBaseline     252 bytes
Coachmark 97.382 kB ExceedsBaseline     252 bytes

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

@JasonGore
Copy link
Member Author

I wish I could request changes on my own PR. 😆 I have two bugs to fix before this should get merged.

@JasonGore JasonGore closed this Apr 23, 2019
@JasonGore JasonGore reopened this Apr 23, 2019
@JasonGore JasonGore requested a review from khmakoto April 23, 2019 18:31
Copy link
Member

@khmakoto khmakoto left a comment

Choose a reason for hiding this comment

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

Left some suggestions but otherwise LGTM 👍

<TextField label="Input inside trap zone" styles={{ root: { width: 300 } }} />
<Link href="https://bing.com">Hyperlink inside trap zone</Link>
</Stack>
<FocusTrapZone disabled={!useTrapZone} isClickableOutsideFocusTrap={true} forceFocusInsideTrap={false}>
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't you just do isClickableOutsideFocus instead of isClickableOutsideFocusTrap={true}?

@JasonGore JasonGore merged commit 97eaa2d into microsoft:master Apr 24, 2019
@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v6.169.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.

Modal's FocusTrapZone, with FocusTrapCallout child, not behaving as expected

5 participants