Skip to content

Current selection should be reset inside reset() #53

@yunyu

Description

@yunyu

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(), which breaks that behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions