Fix removal of multi-line highlights leaving handles in incorrect location

This commit is contained in:
Kovid Goyal 2020-09-14 08:35:44 +05:30
parent a75933fd13
commit 940342b1b1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -786,11 +786,9 @@ class IframeBoss:
if crw_: if crw_:
unwrap_crw(crw_) unwrap_crw(crw_)
v'delete annot_id_uuid_map[crw_]' v'delete annot_id_uuid_map[crw_]'
sel = window.getSelection() # have to remove selection otherwise selection bar does
if not sel.toString(): # not hide itself on multiline selections
# have to remove selection otherwise it remains as the empty window.getSelection().removeAllRanges()
# string, and the selection bar does not hide itself
sel.removeAllRanges()
elif dtype is 'apply-highlight': elif dtype is 'apply-highlight':
sel = window.getSelection() sel = window.getSelection()
if not sel.rangeCount: if not sel.rangeCount: