diff --git a/common/changes/office-ui-fabric-react/revert-active-element-in-iframe-fix_2019-03-22-01-08.json b/common/changes/office-ui-fabric-react/revert-active-element-in-iframe-fix_2019-03-22-01-08.json new file mode 100644 index 00000000000000..62440b70f34163 --- /dev/null +++ b/common/changes/office-ui-fabric-react/revert-active-element-in-iframe-fix_2019-03-22-01-08.json @@ -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" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Popup/Popup.tsx b/packages/office-ui-fabric-react/src/components/Popup/Popup.tsx index e34a3a17a9d056..c05db22bab97e0 100644 --- a/packages/office-ui-fabric-react/src/components/Popup/Popup.tsx +++ b/packages/office-ui-fabric-react/src/components/Popup/Popup.tsx @@ -25,28 +25,7 @@ export class Popup extends BaseComponent { } 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 {