feat: add global listener for Escape key to remove message reply box
This commit is contained in:
parent
a8ee8122ee
commit
daa13dbbed
1 changed files with 7 additions and 0 deletions
7
app.vue
7
app.vue
|
@ -26,6 +26,13 @@ onMounted(() => {
|
||||||
e.target.contentEditable = "false";
|
e.target.contentEditable = "false";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
document.addEventListener("keyup", (e) => {
|
||||||
|
const messageReply = document.getElementById("message-reply") as HTMLDivElement;
|
||||||
|
if (e.key == "Escape" && messageReply) {
|
||||||
|
e.preventDefault();
|
||||||
|
messageReply.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function contextMenuHandler(e: MouseEvent) {
|
function contextMenuHandler(e: MouseEvent) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue