Find active element within iframe#8290
Merged
msft-github-bot merged 5 commits intoMar 15, 2019
Merged
Conversation
Contributor
Author
|
A simpler version of this fix would be to just do an This will fix the issue reported. However, it would not support the case where the |
aftab-hassan
requested review from
KevinTCoughlin,
aditima,
christiango and
cliffkoh
March 13, 2019 00:26
KevinTCoughlin
approved these changes
Mar 13, 2019
KevinTCoughlin
left a comment
Member
There was a problem hiding this comment.
added some minor comments about adding comments :D
JasonGore
approved these changes
Mar 15, 2019
Contributor
|
Hello @KevinTCoughlin! Because this pull request has the |
Contributor
|
🎉 Handy links: |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request checklist
$ npm run changeDescription of changes
Creating this
PRand closing 8071 due to a bad merge. The comments on the linkedPRare resolvediFramereferring to itself, resulting in aninfinite loop, the following check was addedBroader context
In
Popup.tsx, it tries to determine the active element of the site by doingthis._originalFocusedElement = getDocument()!.activeElement as HTMLElement;The issue with that is if there is a frame, the active element will be a reference to the head of the frame, instead of the elements within it.
The fix is to find the active element using
getDocument()!.contentWindow.document.activeElementin case of aniframebeing present, as is the case mentioned in the bug.The above
PRaddresses the conditionsiFramecontains anactive element, as is the case reported in the issueiFramecontains a multi level nesting ofiFrames, which contains anactive element. To address this, thewhileloop was addedFocus areas to test
Create a page with a
panelcontaining aniframeand a focus element like atextbox.On hitting the escape on the
panel, open up a dialog boxOn hitting
escapeon thedialog, control goes back to the focus element (textbox)Microsoft Reviewers: Open in CodeFlow