diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/js/navigate.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/app/js/navigate.js b/src/app/js/navigate.js index 465a7ec..b54bbfd 100644 --- a/src/app/js/navigate.js +++ b/src/app/js/navigate.js @@ -842,4 +842,23 @@ events.on("popup-changed", (e) => { }, 300) }) +// automatically deselect a selection if its no longer visible +setInterval(() => { + // get the active selection + let active_el = document.querySelector(".active-selection"); + + if (! active_el) {return} + + let visible = active_el.checkVisibility({ + checkOpacity: true, + visibilityProperty: true, + checkVisibilityCSS: true, + contentVisibilityAuto: true + }) + + if (! visible) { + navigate.default_selection(); + } +}, 500) + module.exports = navigate; |