diff --git a/app/javascript/dashboard/components-next/NewConversation/ComposeConversation.vue b/app/javascript/dashboard/components-next/NewConversation/ComposeConversation.vue index a27e2ce3f..50ea86b32 100644 --- a/app/javascript/dashboard/components-next/NewConversation/ComposeConversation.vue +++ b/app/javascript/dashboard/components-next/NewConversation/ComposeConversation.vue @@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { useAlert } from 'dashboard/composables'; import { debounce } from '@chatwoot/utils'; +import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents'; import { searchContacts, createNewContact, @@ -115,6 +116,17 @@ watch( onMounted(() => { onContactSearch(''); }); + +const keyboardEvents = { + Escape: { + action: () => { + if (showComposeNewConversation.value) { + showComposeNewConversation.value = false; + } + }, + }, +}; +useKeyboardEvents(keyboardEvents);