Re: [w3c/selection-api] Clarify how text selection in <input> and <textarea> work with Selection interface (#83)

I was testing the selection range with input and textarea, and there is also a difference between Blink/WebKit and Gecko. If some text in a text field or textarea is selected, the selection range in Blink and WebKit seems to be equivalent to a caret selection immediately before the input or textarea (so `range.startContainer === input.parentNode`). Gecko's behavior is much stranger: it seems like if the last non-text-field selection was a range selection, it treats the new selection as empty; but if the last non-text-field selection was a caret selection, it keeps it.

Gecko's behavior is almost certainly unintentional and the result of an implementation bug, but I wonder whether Blink/WebKit's behavior is worth keeping.

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

Message ID: <w3c/selection-api/issues/83/1023073846@github.com>

Received on Thursday, 27 January 2022 10:41:19 UTC