When clicking on selected text, window.getSelection() return the old selection
Reported by
jeansebp...@gmail.com,
Jul 25 2017
|
|||||
Issue descriptionUserAgent: 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
,
Jul 25 2017
,
Jul 25 2017
,
Jul 26 2017
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.
,
Jul 27 2017
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 |
|||||
Comment 1 by jeansebp...@gmail.com
, Jul 25 2017