-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Components: Fix focus loss for Guide Finish button in IE #20599
Conversation
( document.body === | ||
document.activeElement || | ||
! document.activeElement ) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
0e782a0
to
a121e47
Compare
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.activeElement
will often report as beingnull
when there is no focus. This is in contrast to other browsers, where it will commonly report as being thebody
element. 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.