mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Merge pull request #5334 from Chic-Tweetz/fix-hintables-losing-clientRects
Check hintable elements' clientRects still exist when building hints
This commit is contained in:
commit
405ee11d2f
|
|
@ -503,6 +503,7 @@ export function hintPage(
|
|||
reset()
|
||||
return
|
||||
}
|
||||
modeState.hints.forEach(hint => hint.hidden = false)
|
||||
|
||||
// There are multiple hints. Normally we would just show all of them, but
|
||||
// we try to be clever here. Automatically select the first one if all the
|
||||
|
|
@ -741,7 +742,6 @@ class Hint {
|
|||
this.y = window.scrollY + top
|
||||
|
||||
modeState.hintHost.appendChild(this.flag)
|
||||
this.hidden = false
|
||||
}
|
||||
|
||||
public static isHintable(target: Element): boolean {
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ export function isVisible(thing: Element | Range) {
|
|||
thing = thing.parentElement
|
||||
}
|
||||
}
|
||||
if (thing.getClientRects().length === 0) return false
|
||||
const clientRect = thing.getBoundingClientRect()
|
||||
switch (true) {
|
||||
case !clientRect:
|
||||
|
|
|
|||
Loading…
Reference in a new issue