mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-01 07:49:12 -04:00
Repair backward word clipping with extend, not setBaseAndExtent
Rewriting both selection boundaries mid-gesture detaches Chrome's touch selection controller and the selection stops following the finger. extend() moves only the focus, which the controller tolerates.
This commit is contained in:
+1
-2
@@ -630,8 +630,7 @@ export class Paginator extends HTMLElement {
|
|||||||
if (r.compareBoundaryPoints(Range.START_TO_START, probe) <= 0)
|
if (r.compareBoundaryPoints(Range.START_TO_START, probe) <= 0)
|
||||||
return
|
return
|
||||||
if (selectionIsBackward(sel))
|
if (selectionIsBackward(sel))
|
||||||
sel.setBaseAndExtent(sel.anchorNode, sel.anchorOffset,
|
sel.extend(probe.startContainer, probe.startOffset)
|
||||||
probe.startContainer, probe.startOffset)
|
|
||||||
else
|
else
|
||||||
sel.setBaseAndExtent(probe.startContainer, probe.startOffset,
|
sel.setBaseAndExtent(probe.startContainer, probe.startOffset,
|
||||||
sel.focusNode, sel.focusOffset)
|
sel.focusNode, sel.focusOffset)
|
||||||
|
|||||||
Reference in New Issue
Block a user