mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
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:
parent
12707c9756
commit
ccf69016df
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user