ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Methods don't fire after initalization for contenteditable divs #49

Closed tvvignesh closed 8 years ago

tvvignesh commented 8 years ago

The plugin works well and initializes properly and I am able to see all the suggestions loaded via remote url in a contenteditable div.

Initialization: $('.statusinput').mentionsInput({source: "/item_getter.php?key=tagfriend",showAtCaret: true});

I try to get the mentions in the console:

console.log($('.statusinput').mentionsInput('getMentions'));

I get this:

screenshot from 2015-12-29 05-46-28

If I try some other method like:

console.log($('.statusinput').mentionsInput('getValue'));

I get an error like this:

screenshot from 2015-12-29 05-49-00

If I check my contenteditable div after adding a tag, this is how it looks (from inspect element of chrome)

<div class="statusinput mentions ui-autocomplete-input" contenteditable="true" data-placeholder="What would you like to say?" style="height: 102px; overflow-y: hidden;" autocomplete="off">test <strong data-mention="db16abcd03">bhavani v</strong>&#8203;</div>

Basically, only initialization works well for me and I am able to see suggestions and tag people. None of the methods are working. What should I do? Is this a bug?

UPDATE All methods are working if I use a textarea. But the same is not for contenteditable div. So, its a bug