From 940342b1b1abb54113ded1b1d1f41bf151a365be Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Sep 2020 08:35:44 +0530 Subject: [PATCH] Fix removal of multi-line highlights leaving handles in incorrect location --- src/pyj/read_book/iframe.pyj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index 7de617e1a0..3e7c17be63 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -786,11 +786,9 @@ class IframeBoss: if crw_: unwrap_crw(crw_) v'delete annot_id_uuid_map[crw_]' - sel = window.getSelection() - if not sel.toString(): - # have to remove selection otherwise it remains as the empty - # string, and the selection bar does not hide itself - sel.removeAllRanges() + # have to remove selection otherwise selection bar does + # not hide itself on multiline selections + window.getSelection().removeAllRanges() elif dtype is 'apply-highlight': sel = window.getSelection() if not sel.rangeCount: