VisualEditor: Cursor position should account for padding in alien inline blocks


Screenshot of problem.

Steps to reproduce bug:

  • Edit document with with <p>Hello '<code>world</code>'</p> ([[mw:Extension:Thanks#API_Documentation]] at this time)
  • Place cursor at end of sentence and move cursor back with arrow keys one step at a time.

When placed after the first ' before <code>world</code>,
it is blinking in the place new text would appear:


Hello '|{ world }'

It is visible inside and behind the <code>world</code> alien block.
The <code> block has some padding, and it is appearing in front of the "w" of "world" instead of after the first apostrophe:


Hello '{ |world }'

Version: unspecified
Severity: minor


bzimport set Reference to bz48680.
Krinkle created this task.Via LegacyMay 21 2013, 1:56 PM
bzimport added a comment.Via ConduitMay 22 2013, 11:59 PM

orbit wrote:

Yeah, this is reproducible. No adjustment to margin or padding of the alien (the code element) is able to fix this issue though. We're using native browser selection rendering, and this is a side-effect.

One possible future fix would be to allow the cursor to be placed at the first and last offset of protected nodes (contenteditable would have to be set to true) to give the desired cursor rendering. Any keypress would have to first fixup the selection.

I think this is likely a minor occurrence and making such a dramatic change to protectedNodes is out-of-scope for now.

Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 4:19 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.