vue-typeahead icon indicating copy to clipboard operation
vue-typeahead copied to clipboard

Reset current selection when items are reset

Open yunyu opened this issue 7 years ago • 0 comments

I'm currently using this component in a pseudo-form that allows the user to submit the form if the input field receives an enter (not the autocomplete popup). I'm doing this by implementing a processEnter method based off of the onHit method:

    processEnter() {
      if (this.current !== -1) {
        this.onHit(this.items[this.current]);
      } else {
        this.$emit('pressed:enter');
      }
    }

Currently, onHit will be called instead of emitting the enter press event after a reset(). This commit fixes that behavior.

yunyu avatar May 21 '17 23:05 yunyu