mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Move focus cache out of loop
This commit is contained in:
parent
807c998bea
commit
780e8a77c3
1 changed files with 3 additions and 1 deletions
|
@ -185,6 +185,9 @@ export async function recursiveScroll(
|
|||
|
||||
// If that didn't work, go on to recursive scroll
|
||||
node = document.documentElement
|
||||
|
||||
// Invalidate the cache if the user changes focus
|
||||
lastFocused = document.activeElement
|
||||
}
|
||||
}
|
||||
let treeWalker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT)
|
||||
|
@ -202,7 +205,6 @@ export async function recursiveScroll(
|
|||
) {
|
||||
// Cache the node for next time and stop trying to scroll
|
||||
lastRecursiveScrolled = treeWalker.currentNode
|
||||
lastFocused = document.activeElement // Invalidate the cache if the user changes focus
|
||||
lastX = xDistance
|
||||
lastY = yDistance
|
||||
return true
|
||||
|
|
Loading…
Add table
Reference in a new issue