mirror of
https://github.com/turboderp-org/exui.git
synced 2026-04-20 14:29:52 +00:00
Handle escape key in model search box
This commit is contained in:
@@ -56,6 +56,12 @@ export class Models {
|
||||
this.searchState = this.searchBox.tb.value;
|
||||
this.populateModelList();
|
||||
});
|
||||
this.searchBox.tb.addEventListener("keydown", () => {
|
||||
if (event.key === 'Escape' || event.keyCode === 27) {
|
||||
this.searchState = this.textbox_initial;
|
||||
this.populateModelList();
|
||||
}
|
||||
});
|
||||
this.searchContainer.appendChild(this.searchBox.element);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user