New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 675869 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Selection.anchorNode returns the first node on ctrl+a in the contentEditable

Reported by syed.ali...@pearson.com, Dec 20 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Steps to reproduce the problem:
1. place the cursor at the end of second line
2. press ctrl+a / cmd+a to select all the text
3. do not click anywhere on the html page, 
3. open the chrome dev console and click inside the console window to see the log messages 
4. click inside the content editable , do not click anywhere on the html page. this is done to retain the text selection inside, contentEditable

What is the expected behavior?

What went wrong?
You can see the console messsages read (this is the first paragraph), 
instead of reading the second paragraph,  when only the second line is selected, it says "this is the second paragraph", similar behavior is when u do it with the first line

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 54.0.2840.98  Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 24.0 r0
 
focus defect.html
816 bytes View Download

Comment 1 by hdodda@chromium.org, Dec 21 2016

Cc: hdodda@chromium.org
Labels: M-57 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Tested on mac os 10.12.1 using chrome canary M57 #57.0.2957.0 and issue is reproduced.

Issue is seen from M30 and hence it is a non-regression issue.

Marking it as untriaged, so that someone could address this issue.

Thanks !

Comment 2 by kochi@chromium.org, Dec 26 2016

Components: -Blink>Focus Blink>Editing
Labels: Needs-Feedback
Status: Unconfirmed (was: Untriaged)
Since click changes selection so listen the event to just collect current selection is not 
 good practice.
Following code works fine.

<!DOCTYPE html>
<html lang="en">
<body>
<div  id ="input1" style="width: 500px; height: 250px; border: 1px solid black" contenteditable="true">
        <div>This is the first paragraph</div>
        <div>This is the second paragraph</div>
</div>
    <script>
        input1.focus();
        document.execCommand("SelectAll");
        console.log(getSelection().anchorNode);
        console.log(getSelection().focusNode);
    </script>
</body>
</html>

Comment 4 by yosin@chromium.org, Feb 7 2017

Status: Available (was: Unconfirmed)

Comment 5 by yosin@chromium.org, Oct 4 2017

Labels: Pri-3
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 4

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment