Skip to content

Commit

Permalink
Fix keycodes and etc.
Browse files Browse the repository at this point in the history
Co-Authored-By: Valerii <valeriymaslenikov@users.noreply.github.com>
  • Loading branch information
afwn90cj93201nixr2e1re and ValeriyMaslenikov committed Jun 22, 2019
1 parent e97df02 commit a33d751
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/taginput/Taginput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@
},
confirmKeyCodes: {
type: Array,
default: () => [13, 188]
default: () => ['Enter', ',']
},
removeOnKeys: {
type: Array,
default: () => [8]
default: () => ['Backspace']
},
allowNew: Boolean,
onPasteSeparators: {
Expand Down Expand Up @@ -303,13 +303,13 @@
},
keydown(event) {
if (this.removeOnKeys.indexOf(event.keyCode) !== -1 && !this.newTag.length) {
if (this.removeOnKeys.indexOf(event.key) !== -1 && !this.newTag.length) {
this.removeLastTag()
}
// Stop if is to accept select only
if (this.autocomplete && !this.allowNew) return
if (this.confirmKeyCodes.indexOf(event.keyCode) >= 0) {
if (this.confirmKeyCodes.indexOf(event.key) >= 0) {
event.preventDefault()
this.addTag()
}
Expand Down

0 comments on commit a33d751

Please sign in to comment.