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": "Popup: Revert change to find active element within iframe",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "afhassan@microsoft.com"
}
23 changes: 1 addition & 22 deletions packages/office-ui-fabric-react/src/components/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,7 @@ export class Popup extends BaseComponent<IPopupProps, IPopupState> {
}

public componentWillMount(): void {
let tempActive: Element | null = null;
let tempActiveLastSeen: Element | null = null;
const doc: Document | undefined = getDocument();

if (doc) {
tempActive = doc.activeElement;
}

// Seek inner-most frame's activeElement to set focus on dismissal
while (tempActive !== null && tempActive instanceof HTMLIFrameElement) {
if (tempActive.contentDocument !== null && tempActive.contentDocument.activeElement !== null) {
tempActiveLastSeen = tempActive;
tempActive = tempActive.contentDocument.activeElement;
if (tempActive === tempActiveLastSeen) {
break;
}
}
}

if (tempActive !== null) {
this._originalFocusedElement = tempActive as HTMLElement;
}
this._originalFocusedElement = getDocument()!.activeElement as HTMLElement;
}

public componentDidMount(): void {
Expand Down