Skip to content

Commit

Permalink
resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller authored and grahamlangford committed Mar 7, 2024
1 parent c40c696 commit f439bb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/focusController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const focusController = {
// Only HTMLElements can have their focus restored, but we're currently ignoring this distinction
const active = document.activeElement as HTMLElement;

if (active === document.body) {
// Don't save the body as the focused element. Can happen if when the user clicks the text selection popover,
// which then disappears.
focusedElement = undefined;
return;
}

if (focusedElement != null && focusedElement !== active) {
console.warn(
"focusController: the previously-saved focus is being overridden",
Expand Down

0 comments on commit f439bb6

Please sign in to comment.