Re: [w3c/selection-api] setPosition/collapse should taken an optional argument for whether the caret is before or after a line break (#51)

marijnh left a comment (w3c/selection-api#51)

You can put the cursor one past the position you want, and then move it back to the proper position with [`Selection.modify`](https://developer.mozilla.org/en-US/docs/Web/API/Selection/modify)—if you move backwards, it'll associate with the text after it, if you move forward with the text before it. But that is a really terrible hack.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/selection-api/issues/51#issuecomment-3286414603
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/selection-api/issues/51/3286414603@github.com>

Received on Friday, 12 September 2025 18:29:25 UTC