text selection is lost on medium.com in Firefox, but not in Chrome
Categories
(Core :: DOM: Selection, defect)
Tracking
()
Webcompat Priority | P2 |
People
(Reporter: ksenia, Unassigned)
References
()
Details
Attachments
(1 file)
700 bytes,
text/html
|
Details |
We've received a report in https://github.com/webcompat/web-bugs/issues/95826 about a problem on medium.com where upon selecting text on the page, the selection is lost.
This is happening because the site is using .focus()
on a different element in the mouseup
event handler. I've attached a reduced test case.
To reproduce:
Open the attached test case, select text on the page and release the mouse button to trigger mouseup
event.
The site is relying on Chrome's behaviour, where selection is kept.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Hmm, aligning the behavior to Chrome could break something other thins, e.g., caret browsing and/or a11y module...
However, according to this comment,
// update the caret visibility and position to match the newly focused
// element. However, don't update the position if this was a focus due to a
// mouse click as the selection code would already have moved the caret as
// needed. If this is a different document than was focused before, also
// update the caret's visibility. If this is the same document, the caret
// visibility should be the same as before so there is no need to update it.
Not updating Selection
in this scenario seems okay.
Comment 2•3 years ago
|
||
FWIW selection is also lost in WebKitGTK. I think collapsing selection here makes a fair amount of sense.. Maybe we can contact Medium?
Comment 3•3 years ago
|
||
FWIW,
Select text in any website, then press [Tab] key to move focus.
The selection is lost in Firefox, but not in Chrome if the focused element is in the document.
Reporter | ||
Comment 4•3 years ago
|
||
FWIW selection is also lost in WebKitGTK. I think collapsing selection here makes a fair amount of sense.. Maybe we can contact Medium?
I've reached out to Medium via https://help.medium.com/hc/en-us/requests/new (support ticket #740098)
Reporter | ||
Comment 5•3 years ago
|
||
Here is the update from Medium:
Hello,
Thanks for reaching out. We do have a ticket tracking this issue, and the team is working on it now.
I've added your email to the ticket. Please bear with us while we get to it.
Comment 6•3 years ago
|
||
We should open a bug on chromium
and eventually the spec if the spec is not clear enough, maybe html spec.
Comment 7•3 years ago
|
||
The selection is lost on WebKit too.
Anne, would you know if it's an issue worth opening on the HTML spec.
https://w3c.github.io/selection-api/
https://html.spec.whatwg.org/
I opened a bug on Chromium
https://bugs.chromium.org/p/chromium/issues/detail?id=1300132
Updated•3 years ago
|
Updated•3 years ago
|
Reporter | ||
Comment 8•3 years ago
|
||
This has been addressed by Medium.
Description
•