Components: Fix focus loss for Guide Finish button in IE#20599
Merged
Conversation
aduth
commented
Mar 2, 2020
Comment on lines
+119
to
+121
| ( document.body === | ||
| document.activeElement || | ||
| ! document.activeElement ) && |
Member
Author
There was a problem hiding this comment.
Aside: I would have liked to avoid the ambiguity here of === in possibly evaluating as "equal to the result of document.activeElement || ! document.activeElement" (wrong), but apparently Prettier is opinionated about this, and will not allow for the (apparently redundant) extra parentheses around ( document.body === document.activeElement ).
|
Size Change: +9 B (0%) Total Size: 842 kB
ℹ️ View Unchanged
|
gziolo
approved these changes
Apr 16, 2020
0e782a0 to
a121e47
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously: #18041 (comment)
This pull request seeks to resolve two conditions which detect the absence of focus, but only consider one of the two possible values for there being no focus:
https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement
Notably, in Internet Explorer,
document.activeElementwill often report as beingnullwhen there is no focus. This is in contrast to other browsers, where it will commonly report as being thebodyelement. The affected code had previously only been accounting for the latter of these two.Testing Instructions:
Verify that there is no focus loss when using the keyboard to navigate between steps of the Welcoem Modal in Internet Explorer.