Handle escape key in model search box

This commit is contained in:
turboderp
2025-02-04 21:20:51 +01:00
parent 8a08bd5580
commit dd48d472f1

View File

@@ -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);
}