ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

Autocomplete should put the selection after output template

Open mlewand opened this issue 7 years ago • 0 comments

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

This plugin is based on not yet published Mentions feature branch t/1703-b.

  1. Open output template manual test.
  2. Focus the editor.
  3. Type "@" to start autocompleteion.
  4. Accept first entry.
  5. Type " and " (note spaces).
  6. Type "@" to start another autocompletion.
  7. Accept first entry.

Expected result

Text between the autocompleted values should not be bolded.

Actual result

The text is bolded.

Reason is that the selection gets inside of the inserted element.

There are two solutinos to that:

  • Put a selection outside that element (might be impossible on WebKits due to their normalization).
  • Add an option to insert a space after the insertion. This option could be technically realized by adding a space to outputTemplate but the problem is if there is already a space after the text where you started autocompletion, it would just stupidly insert a space there resulting with two spaces.

Other details

This issue is a follow up of https://github.com/ckeditor/ckeditor-dev/pull/1992#pullrequestreview-123272523.

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.10.0

mlewand avatar May 25 '18 09:05 mlewand