ckeditor5-inspector icon indicating copy to clipboard operation
ckeditor5-inspector copied to clipboard

Selection is being displayed incorrectly around the `linkHref` nodes

Open pomek opened this issue 5 years ago • 3 comments

Something wrong happens around links. Check out screenshots attached in the issues listed below:

  • https://github.com/ckeditor/ckeditor5/issues/7568 ("amet" is highlighted, inspector renders selection after the node)
  • https://github.com/ckeditor/ckeditor5/issues/7588 ("CKSource." is highlighted, inspector renders selection after the node)

pomek avatar Jul 09 '20 07:07 pomek

Can you write this as expected vs actual? I'm having a hard time figuring out what the problem is.

oleq avatar Jul 09 '20 12:07 oleq

In both cases, editor's selection is at the end of a link. The inspector shows it outside, in the next node.

pomek avatar Jul 09 '20 12:07 pomek

There's no such thing as a selection in the textnode in the model. <$text linkHref>foo[]</$text> and <$text linkHref>foo</$text>[] are one and the same position. So from this perspective, the inspector does not lie.

What could be improved, though, is the normalization of the caret rendering because I admit this could be annoying in certain situations.

oleq avatar Jul 09 '20 12:07 oleq