Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleKeyPress(event) {
let { key } = event;
let type = this.get('type');
let numbersSpec = /[\d.eE+-]$/;
if (
type !== 'number' ||
getCode(event) === 'Enter' ||
key.match(numbersSpec)
) {
return;
}
event.preventDefault();
},
},
keyDown(e) {
let key = getCode(e);
switch (key) {
case 'ArrowDown':
case 'ArrowUp':
case 'Comma':
case 'Enter':
e.preventDefault();
break;
default:
this._super(...arguments);
}
get(this, 'getKeyDown')(key);
}
});