matiastucci/vue-input-tag

Tab key no longer works because of #45 even though it's defined as a default

flawiddsouza opened this issue · 1 comments

From https://github.com/matiastucci/vue-input-tag/blob/d818062077ba9696ee811ba49120c360429aa589/src/InputTag.vue:
Tab key is in the default array for addTagOnKeys

addTagOnKeys: {
  type: Array,
  default: function () {
    return [
      13, // Return
      188, // Comma ','
      9 // Tab
    ]
  }
}

But it's being rendered useless by this check:

// We prevent default & stop propagation for all 
// keys except tabs (used to move between controls)
if (e && e.keyCode !== 9) {
  e.stopPropagation()
  e.preventDefault()
}

Which means even manually attaching an array with the tab key code to addTagOnKeys prop isn't going to make a difference. I recommend removing tab from the default array and removing the check for the tab key, so that tab can then be manually enabled using the addTagOnKeys prop.

Yup, makes sense. This should be fixed in #54. Thanks 👍