From ccf69016dfb6853478d2242ab45af2be9aab6fcc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 30 Jan 2021 10:54:34 +0530 Subject: [PATCH] Content server: Fix dragging selection handles not working in Safari. Fixes #1913854 [Cannot drag text selection handle on iOS touch screen devices](https://bugs.launchpad.net/calibre/+bug/1913854) Apparently on safari to modify a selection its not enough to modify the range, one has to set the range on the selection --- src/pyj/select.pyj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pyj/select.pyj b/src/pyj/select.pyj index 0a8bc1b418..3faa901c08 100644 --- a/src/pyj/select.pyj +++ b/src/pyj/select.pyj @@ -200,6 +200,10 @@ def move_end_of_selection(pos, start): if start: if r.startContainer is not p.offsetNode or r.startOffset is not p.offset: r.setStart(p.offsetNode, p.offset) + sel.removeAllRanges() + sel.addRange(r) else: if r.endContainer is not p.offsetNode or r.endOffset is not p.offset: r.setEnd(p.offsetNode, p.offset) + sel.removeAllRanges() + sel.addRange(r)