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
This commit is contained in:
Kovid Goyal 2021-01-30 10:54:34 +05:30
parent 12707c9756
commit ccf69016df
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)