We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 714dfa0 commit b60712bCopy full SHA for b60712b
web_app/static/ts/search.ts
@@ -159,6 +159,7 @@ export class SearchBox {
159
160
this.appendNoResult();
161
input.addEventListener('input', delay(this.onInput.bind(this), 800))
162
+ input.addEventListener('keydown', this.onKeyDown.bind(this))
163
if (input.value.length > 0) {
164
this.search(input.value)
165
}
@@ -170,6 +171,13 @@ export class SearchBox {
170
171
172
173
174
+ private onKeyDown(evt: KeyboardEvent): void {
175
+ if (evt.key === 'Enter' && evt.target instanceof HTMLInputElement) {
176
+ evt.preventDefault()
177
+ this.search(evt.target.value)
178
+ }
179
180
+
181
private search(searchTerm: string): void {
182
const splitter = /[\s_\-.,;:]+/g
183
this.rawSearchTerm = searchTerm
0 commit comments