From 69cfd59fb9e6f93aa4221d55d3f659d3c3b8b8b2 Mon Sep 17 00:00:00 2001 From: Gabriel Moreira Date: Wed, 14 Oct 2026 11:02:24 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Adicionado=20suport=20para=20o=20bot=C3=A3o?= =?UTF-8?q?=20no=20esc=20no=20modal=20de=20cria=C3=A7=C3=A3o=20de=20docume?= =?UTF-8?q?ntos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/Components/AppTextEditor.vue | 11 +++++++++-- .../Partials/Actions/HandleDocumentsDialog.vue | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/resources/js/Components/AppTextEditor.vue b/resources/js/Components/AppTextEditor.vue index 12eee03f..510fabbe 100644 --- a/resources/js/Components/AppTextEditor.vue +++ b/resources/js/Components/AppTextEditor.vue @@ -50,7 +50,14 @@ const props = defineProps({ }, }); -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'escape']); + +// Keyboard events inside TinyMCE's iframe do not reach the parent dialog. +function handleKeyDown(event) { + if (event.key === 'Escape' && !event.defaultPrevented) { + emit('escape'); + } +} const editorValue = computed({ get: () => props.modelValue, @@ -80,7 +87,7 @@ const editorInit = computed(() => ({ {{ label }} - +
{{ error }} diff --git a/resources/js/Pages/Projects/Partials/Actions/HandleDocumentsDialog.vue b/resources/js/Pages/Projects/Partials/Actions/HandleDocumentsDialog.vue index f171f1f4..093d21e4 100644 --- a/resources/js/Pages/Projects/Partials/Actions/HandleDocumentsDialog.vue +++ b/resources/js/Pages/Projects/Partials/Actions/HandleDocumentsDialog.vue @@ -59,7 +59,14 @@ const dialogTitle = computed(() => { const isOpen = computed({ get: () => props.modelValue, - set: (val) => emit('update:modelValue', val), + set: (val) => { + if (!val) { + closeDialog(); + return; + } + + emit('update:modelValue', val); + }, }); const form = useForm({ @@ -282,7 +289,7 @@ watch(