diff --git a/lib/strategies/base.js b/lib/strategies/base.js index d48f6ab..7e413be 100644 --- a/lib/strategies/base.js +++ b/lib/strategies/base.js @@ -46,6 +46,12 @@ BaseStrategy.prototype._attachListeners = function () { } }); self.inputElement.addEventListener('keypress', function (event) { + // Simulated event. For example, 1Password sets input.value then fires keyboard events. Dependent on browser + // here might be falsy values (key = '', keyCode = 0) or these keys might be omitted + if (!event.key && !event.keyCode) { + self.isFormatted = false; + } + if (keyCannotMutateValue(event)) { return; } self._unformatInput(event); });