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

Issue 821578 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Incorrect cursor position for custom elements inside a <div contenteditable>

Project Member Reported by n...@chromium.org, Mar 13 2018

Issue description

Chrome Version: 64.0.3282.186 (Official Build) (64-bit)
OS: Mac

What steps will reproduce the problem?
(1) Go to http://output.jsbin.com/xopinor
(full code here: http://jsbin.com/xopinor/edit?html,output)
(2) Advance the cursor with the keyboard arrows to the period right before the yellow custom element, then press Right Arrow. The cursor will skip to after the custom element *and* the period immediately following it.
(3) Similarly, advance to right after the second period, and press the Left Arrow. The cursor would jump over the last period, over the custom element and to after the period preceding it

What is the expected result? 
The cursor should move to directly after the custom element. 
Safari does this behaviour correctly.

What happens instead?
The cursor treats the custom element as glued to the character immediately after it.
 

Comment 1 by n...@chromium.org, Mar 13 2018

Components: Blink>Editing>Content

Comment 3 by kochi@chromium.org, Mar 14 2018

Owner: yosin@chromium.org
Status: Assigned (was: Untriaged)
Yosin, could you take a look at this?

Comment 4 by n...@chromium.org, Mar 14 2018

did some more investigation, and the character immediately before the shadow root looks "sticky" as well: if you move the cursor after the first period (but before the custom element), and press "backspace", the custom element gets deleted, not the period. 

Comment 5 by yosin@chromium.org, Mar 20 2018

Owner: ----
Status: Available (was: Assigned)
Shadow Root version:
https://jsfiddle.net/hy3fu4s9/6/

- Before.|SKIP ME.After => Before.|SKIP ME.After ; no move
- Before.|SKIP ME.After Shift+=> Before.^SKIP ME.|After
- Before.SKIP ME.|After <= Before.|SKIP ME.After
- Can not place caret to Before.SKIP ME|.After

I'm not sure why shadow root only version differs custom element version.

# Reference
content editable = false
https://jsfiddle.net/y104g8mn/1/

Comment 6 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org
Components: -Blink>DOM>ShadowDOM

Sign in to add a comment