GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

Adding hyperlink on enter removing the text in IE? #393

Closed mallikarjuna909 closed 7 years ago

mallikarjuna909 commented 7 years ago

While adding the hyperlink, if we hit on enter instead of tick button then it is removing the text in IE?

mallikarjuna909 commented 7 years ago

I resolved this issue by adding this line ev.preventDefault(); inside enter key!!

LinkDialog.prototype._addDOMEventListeners = function () { this._domInput.addEventListener('keypress', (function (_this) { return function (ev) { if (ev.keyCode === 13) { ev.preventDefault(); // Add this line return _this.save(); } }; })(this));