Fix formatting for simulated keyboard event
This commit is contained in:
Родитель
ea5e16748b
Коммит
f07ae00396
|
@ -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);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче