diff --git a/dist/tribute.js b/dist/tribute.js index 67745860..052c2c3b 100644 --- a/dist/tribute.js +++ b/dist/tribute.js @@ -348,7 +348,12 @@ if (!Array.prototype.find) { if (!this.tribute.isActive) return false; if (this.tribute.current.mentionText.length === 0) { - return true; + var eventKeyPressed = false; + TributeEvents.keys().forEach(function (o) { + if (event.keyCode === o.key) eventKeyPressed = true; + }); + + return !eventKeyPressed; } return false; @@ -360,6 +365,8 @@ if (!Array.prototype.find) { instance.updateSelection(this); + if (event.keyCode === 27) return; + if (!instance.tribute.isActive) { var _ret2 = function () { var keyCode = instance.getKeyCode(instance, _this5, event); diff --git a/src/tribute.js b/src/tribute.js index 2ba13c68..4aa774e7 100644 --- a/src/tribute.js +++ b/src/tribute.js @@ -297,7 +297,12 @@ if (!Array.prototype.find) { if (!this.tribute.isActive) return false if (this.tribute.current.mentionText.length === 0) { - return true + let eventKeyPressed = false + TributeEvents.keys().forEach(o => { + if (event.keyCode === o.key) eventKeyPressed = true + }) + + return !eventKeyPressed } return false @@ -306,6 +311,8 @@ if (!Array.prototype.find) { keyup(instance, event) { instance.updateSelection(this) + if (event.keyCode === 27) return + if (!instance.tribute.isActive) { let keyCode = instance.getKeyCode(instance, this, event)