Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "FocusTrapZone: Fix for zones that have zero tabbable elements.",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "jagore@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ export class FocusTrapZone extends BaseComponent<IFocusTrapZoneProps, {}> implem
const { className, ariaLabelledBy } = this.props;
const divProps = getNativeProps(this.props, divProperties);

const bumperStyle: React.CSSProperties = {
pointerEvents: 'none',
position: 'fixed' // 'fixed' prevents browsers from scrolling to bumpers when viewport does not contain them
};
const bumperProps = {
style: {
pointerEvents: 'none',
position: 'fixed' // 'fixed' prevents browsers from scrolling to bumpers when viewport does not contain them
},
tabIndex: 0,
'aria-hidden': true,
'data-is-visible': true
} as React.HTMLAttributes<HTMLDivElement>;

return (
<div
Expand All @@ -75,9 +80,9 @@ export class FocusTrapZone extends BaseComponent<IFocusTrapZoneProps, {}> implem
onFocus={this._onRootFocus}
onBlur={this._onRootBlur}
>
<div ref={this._firstBumper} onFocus={this._onFirstBumperFocus} style={bumperStyle} tabIndex={0} aria-hidden={true} />
<div {...bumperProps} ref={this._firstBumper} onFocus={this._onFirstBumperFocus} />
{this.props.children}
<div ref={this._lastBumper} onFocus={this._onLastBumperFocus} style={bumperStyle} tabIndex={0} aria-hidden={true} />
<div {...bumperProps} ref={this._lastBumper} onFocus={this._onLastBumperFocus} />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ exports[`HoverCard renders ExpandingCard correctly 1`] = `
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -170,6 +171,7 @@ exports[`HoverCard renders ExpandingCard correctly 1`] = `
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -328,6 +330,7 @@ exports[`HoverCard renders PlainCard correctly 1`] = `
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand All @@ -353,6 +356,7 @@ exports[`HoverCard renders PlainCard correctly 1`] = `
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ exports[`Modal renders Modal correctly 1`] = `
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand All @@ -158,6 +159,7 @@ exports[`Modal renders Modal correctly 1`] = `
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -289,6 +291,7 @@ exports[`Modal renders Modeless Modal correctly 1`] = `
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand All @@ -311,6 +314,7 @@ exports[`Modal renders Modeless Modal correctly 1`] = `
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ exports[`Panel renders Panel correctly 1`] = `
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -408,6 +409,7 @@ exports[`Panel renders Panel correctly 1`] = `
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@ exports[`Component Examples renders CommandBar.CommandBarButtonAs.Example.tsx co
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -2350,6 +2351,7 @@ exports[`Component Examples renders CommandBar.CommandBarButtonAs.Example.tsx co
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ exports[`Component Examples renders Panel.HiddenOnDismiss.Example.tsx correctly
>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down Expand Up @@ -493,6 +494,7 @@ exports[`Component Examples renders Panel.HiddenOnDismiss.Example.tsx correctly
</div>
<div
aria-hidden={true}
data-is-visible={true}
onFocus={[Function]}
style={
Object {
Expand Down