Open igniteajaysuwalka opened 7 years ago
So I figured this out. Change this line:
https://github.com/podio/jquery-mentions-input/blob/master/jquery.mentionsInput.js#L509
to:
newMentionText = newMentionText.replace(match[0], match[2]);
Otherwise your trigger char doubles up. Then use the defaultValue
configuration option when instantiating.
Unfortunately this appears to be the only way to set a custom value programmatically. You could duplicate this method and pass an argument to it, though, if you need it.
https://github.com/podio/jquery-mentions-input/blob/master/jquery.mentionsInput.js#L542-L544
You can actually change the val method behaviour:
val : function (callback) { if (!_.isFunction(callback)) { resetInput(callback); return; } callback.call(this, mentionsCollection.length ? elmInputBox.data('messageText') : getInputBoxValue()); },
If I already have the markup in textarea then I would want to be converted to Mention input. or else some sort of reset value or set value I need