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


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.May 21 2013, 1:56 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.

Add Comment