Skip to content

Commit

Permalink
fix: clear results list when pressing enter (#372)
Browse files Browse the repository at this point in the history
Fixes #371.

Co-authored-by: Stephan Meijer <stephan.meijer@gmail.com>
  • Loading branch information
tstibbs and smeijer committed Oct 4, 2023
1 parent b2ebd12 commit 0979b4d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/SearchControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ const Control: SearchControl = {
},

async onSubmit(query) {
this.resultList.clear();
const { provider } = this.options;

const results = await provider!.search(query);

Check warning on line 388 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

Forbidden non-null assertion
Expand Down
1 change: 0 additions & 1 deletion src/resultList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default class ResultList {
}

const idx = Number(target.getAttribute('data-key'));
this.clear();
this.handleClick({ result: this.results[idx] });
};
}

0 comments on commit 0979b4d

Please sign in to comment.