From dc125e0b815be746122c10146f465b777c75e63b Mon Sep 17 00:00:00 2001 From: Aftab Hassan Date: Thu, 21 Mar 2019 18:04:35 -0700 Subject: [PATCH 1/2] revert fix to find active element within iframe --- .../src/components/Popup/Popup.tsx | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) 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 { From 1dddd5a2ac6338aaefbd53530178aa1441771f96 Mon Sep 17 00:00:00 2001 From: Aftab Hassan Date: Thu, 21 Mar 2019 18:08:49 -0700 Subject: [PATCH 2/2] add change file --- ...active-element-in-iframe-fix_2019-03-22-01-08.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/office-ui-fabric-react/revert-active-element-in-iframe-fix_2019-03-22-01-08.json 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