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:
John O'Keefe
2026-09-13 20:19:26 -04:00
parent 3fcfc30bd0
commit 1bd7e52417
+1 -2
View File
@@ -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)