From 3c087af038b8d2d7dc7fbe4c3deff33fab89f1a5 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Tue, 4 May 2021 23:56:10 +0200 Subject: [PATCH] caretPosition: fix loading when iframe is hidden --- src/static/js/caretPosition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/caretPosition.js b/src/static/js/caretPosition.js index 077fe58fc..03af77f33 100644 --- a/src/static/js/caretPosition.js +++ b/src/static/js/caretPosition.js @@ -195,7 +195,7 @@ const getSelectionRange = () => { return; } const selection = window.getSelection(); - if (selection.rangeCount > 0) { + if (selection && selection.type !== 'None' && selection.rangeCount > 0) { return selection.getRangeAt(0); } else { return null;