mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-22 07:04:53 +08:00
close text modal on escape press
This commit is contained in:
@@ -215,9 +215,13 @@ class Dialog {
|
||||
this.$el.querySelectorAll("[close]").forEach((el) => {
|
||||
el.addEventListener("click", (e) => this.hide());
|
||||
});
|
||||
this.$el.querySelectorAll("[role=\"textbox\"]").forEach((el) => {
|
||||
el.addEventListener("click", (e) => this.hide());
|
||||
this.$el.querySelectorAll('[role="textbox"]').forEach((el) => {
|
||||
el.addEventListener("keypress", (e) => {
|
||||
if (e.key == "Escape") {
|
||||
this.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
this.$autoFocus = this.$el.querySelector("[autofocus]");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user