src/mixins/multipleSelection.js
/**
     * Select and unselect tags using the metaKey only for mouse events
     */
Select and unselect tags using the metaKey only for mouse events
Select and unselect tags using the metaKey only for mouse events
metaKeyClickSelection(event, tagName) {
      if (this.metaKey && event instanceof MouseEvent) {
        if (this.activeTags.includes(tagName)) {
          this.activeTags.splice(this.activeTags.indexOf(tagName), 1);
          if (this.activeTags.length) {
            this.$refs.selectedTags.focusTag(this.activeTags[0]);
          } else {
            this.focusInput();
          }
        } else {
          this.activeTags.push(tagName);
        }
      }
    }
metaKeyClickSelection ( event , tagName ) { if ( this . metaKey && event instanceof MouseEvent ) { if ( this . activeTags . includes ( tagName ) ) { this . activeTags . splice ( this . activeTags . indexOf ( tagName ) , 1 ) ; if ( this . activeTags . length ) { this . $refs . selectedTags . focusTag ( this . activeTags [ 0 ] ) ; } else { this . focusInput ( ) ; } } else { this . activeTags . push ( tagName ) ; } } }
Select and unselect tags using the metaKey only for mouse events
Select and unselect tags using the metaKey only for mouse events
// If a user clicks with the mouse holding the meta key // deletes a tag when it's included in the active tags // Remove focus from tag and focus first active tag or input depending on // if there are active tags or not // If a tag is not included in the active tags we should add it to the active tags