mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-30 23:49:10 -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)
|
||||
return
|
||||
if (selectionIsBackward(sel))
|
||||
sel.setBaseAndExtent(sel.anchorNode, sel.anchorOffset,
|
||||
probe.startContainer, probe.startOffset)
|
||||
sel.extend(probe.startContainer, probe.startOffset)
|
||||
else
|
||||
sel.setBaseAndExtent(probe.startContainer, probe.startOffset,
|
||||
sel.focusNode, sel.focusOffset)
|
||||
|
||||
Reference in New Issue
Block a user