Skip to content

Commit

Permalink
Merge pull request #4 from BlueprintSys/stor-11705_a
Browse files Browse the repository at this point in the history
Stor 11705 a
  • Loading branch information
fabgallo authored Jul 17, 2018
2 parents 829e6fc + 06cdbb1 commit 04a3356
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@
case 1: // The user has removed everything except the delimiter. We need to remove some extra tags that TinyMce adds to keep the autocomplte working
var caret = this.editor.dom.select('span#autocomplete span#_mce_caret')[0];
var searchtext = this.editor.dom.select('span#autocomplete span#autocomplete-searchtext')[0];
this.editor.dom.add(caret.parentElement, searchtext);
this.editor.dom.remove(caret);

if (caret && searchtext) {
this.editor.dom.add(caret.parentElement, searchtext);
this.editor.dom.remove(caret);
}

this.editor.selection.select(this.editor.selection.dom.select('span#autocomplete-searchtext span')[0]);
this.editor.selection.collapse(0);
Expand Down

0 comments on commit 04a3356

Please sign in to comment.