Fixed error in text-input mixin when using auto-fill

no issue
- `event.keyCode` can be `undefined` when using Chrome or Safari's login auto-fill
This commit is contained in:
Kevin Ansfield 2018-05-01 14:54:37 +01:00
parent 83d2f70792
commit 39cddf0da5

View File

@ -61,10 +61,12 @@ export default Mixin.create({
},
keyUp(event) {
let methodName = this._getMethodFromKeyCode(event.keyCode);
let method = this.get(`keyEvents.${methodName}`);
if (method) {
method(event.target.value);
if (event.keyCode) {
let methodName = this._getMethodFromKeyCode(event.keyCode);
let method = this.get(`keyEvents.${methodName}`);
if (method) {
method(event.target.value);
}
}
},