StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
220 stars 95 forks source link

Fix issue with non breaking space after delimiter #61

Open jpopesculian opened 7 years ago

jpopesculian commented 7 years ago

Autocomplete can jump to the beginning of a node if there's a non breaking space after the delimiter when typing:

TinyMCE content:

<p>Hello my name is&nbsp;!</p>

If you were to type

<p>Hello my name is @&nbsp;!</p>

The autocomplete would fire and your cursor would select the beginning of the paragraph. The solution is just to reference the delimiter id when reselecting

StevenDevooght commented 7 years ago

Thx, I will have a look why the tests are failing.

StevenDevooght commented 7 years ago

Hi, I cannot really reproduce this issue...

The element you are selecting in the dom does not even exist? 'span#autocomplete-searchtext span#autocomplete-delimiter'