New issue
Advanced search Search tips

Issue 748546 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

When clicking on selected text, window.getSelection() return the old selection

Reported by jeansebp...@gmail.com, Jul 25 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
1. Select text
2. Click inside the range of the selected text
3. Check the result of window.getSelection()

https://jsfiddle.net/Thuranel/43407cmL/1/

What is the expected behavior?
window.getSelection() returns the result of the new selection. The returned range should either be 0,0 or a range of where you clicked to where you clicked (ex: You clicked on range 10, the returned range should be 10,10)

What went wrong?
window.getSelection() returned the range of the old selection

Did this work before? N/A 

Chrome version: 59.0.3071.115  Channel: stable
OS Version: 10.0
Flash Version: 

Does this work in other browsers? Yes
 
Updated jsfiddle with better explanation: https://jsfiddle.net/Thuranel/xLLjoc6g/
Components: -Blink Blink>Editing>Selection
Labels: Needs-Triage-M60 Needs-Bisect
Cc: pnangunoori@chromium.org
Labels: -Needs-Bisect -Needs-Triage-M60 M-62
Status: Untriaged (was: Unconfirmed)
Tested on Chrome Stable #59.0.3071.115 & Canary #62.0.3166.0 on Mac 10.12.5, Windows 7, 10 & Ubuntu 14.04 and able to reproduce the issue. 

This is a non-regression issue and able to reproduce from M-45 #45.0.2454.85. Marking it as untriaged so that issue gets addressed.

Thanks.

Comment 5 by yosin@chromium.org, Jul 27 2017

Status: WontFix (was: Untriaged)
Mark WontFix, since Chrome and Edge behave same. Maybe Safari too.
So, Firefox may want to change the behavior for improving interoperability.

I updated the sample: https://jsfiddle.net/43407cmL/5/

After click in selected text:
- Chrome: select nothing
- Edge: select nothing
- Firefox: set caret to clicked position

When we click selected text in content editable, it moves caret to clicked position as
what Firefox does for non-content editable.

Sign in to add a comment