commit
6802912517
|
@ -129,6 +129,13 @@ export default {
|
|||
this.$emit('blur', event);
|
||||
},
|
||||
onKeyDown(event) {
|
||||
const newValue = this.tokens.join('');
|
||||
let limitReached = false;
|
||||
|
||||
if (newValue.length >= this.length) {
|
||||
limitReached = true;
|
||||
}
|
||||
|
||||
const keyCode = event.keyCode;
|
||||
|
||||
switch (keyCode) {
|
||||
|
@ -168,6 +175,10 @@ export default {
|
|||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (limitReached && event.keyCode != 46) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue