fix(gui): close invite modal on escape key press

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2023-01-28 17:54:19 +05:30
parent 3b19d6d7c0
commit 3bc404c42a
2 changed files with 35 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ import {
projectRoleTagColors,
projectRoles,
ref,
useActiveKeyupListener,
useCopy,
useDashboard,
useI18n,
@@ -138,6 +139,16 @@ const clickInviteMore = () => {
const emailField = (inputEl: typeof Input) => {
inputEl?.$el?.focus()
}
useActiveKeyupListener(
computed(() => show),
(e: KeyboardEvent) => {
console.log(e.key)
if (e.key === 'Escape') {
emit('closed')
}
},
)
</script>
<template>