ivirabyan / jquery-mentions

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

Style Background Transparent Not removed on Destroy #87

Open Johnferguson1440 opened 2 months ago

Johnferguson1440 commented 2 months ago

When mentionsInput is initialized it adds the style background transparent. Found that when you destroy the mentionsInput the style remains on the element. I would expect when destroy is called that everything that was added would be removed. Currently just manually removing the background color when calling destroy. Possible solution to add to the destroy method is to set the background for the input to empty string to prevent unwanted css applied.

Johnferguson1440 commented 2 months ago

This fixes it for me if i update the js file MentionsInput.prototype.destroy = function() { this.input.areacomplete("destroy"); this.input.off("." + namespace).attr('name', this.hidden.attr('name')); this.input.css('backgroundColor', ''); return this.container.replaceWith(this.input); };