diff --git a/common/content/commandline.js b/common/content/commandline.js index 0ffd2bbe..acc0c09a 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -912,7 +912,7 @@ var CommandLine = Module("commandline", { * @param {string} val The new value. */ replace: function replace(val) { - delete this.input.dactylKeyPress; + this.input.dactylKeyPress = undefined; if (this.completions) this.completions.previewClear(); this.input.value = val; @@ -1031,7 +1031,7 @@ var CommandLine = Module("commandline", { this.caret = this.prefix.length + completion.length; this._caret = this.caret; - delete this.input.dactylKeyPress; + this.input.dactylKeyPress = undefined; }, get caret() this.editor.selection.getRangeAt(0).startOffset, diff --git a/common/content/events.js b/common/content/events.js index 168e6a59..0bf5e0fc 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1026,7 +1026,7 @@ var Events = Module("events", { let elem = event.originalTarget; elem.dactylKeyPress = elem.value; util.timeout(function () { - if (elem.value !== elem.dactylKeyPress) + if (elem.dactylKeyPress !== undefined && elem.value !== elem.dactylKeyPress) events.dispatch(elem, events.create(elem.ownerDocument, "input")); delete events.dactylKeyPress; });