diff --git a/resources/js/Components/AppTextEditor.vue b/resources/js/Components/AppTextEditor.vue index 12eee03f..1775a8e3 100644 --- a/resources/js/Components/AppTextEditor.vue +++ b/resources/js/Components/AppTextEditor.vue @@ -50,7 +50,13 @@ const props = defineProps({ }, }); -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'escape']); + +function handleKeyDown(event) { + if (event.key === 'Escape' && !event.defaultPrevented) { + emit('escape'); + } +} const editorValue = computed({ get: () => props.modelValue, @@ -80,7 +86,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(