From 39604a15db5d5e98e793ac1f1434f87bc6d1e2ed Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Thu, 27 Feb 2025 06:58:16 +0000 Subject: [PATCH] fix: styling and keyboard usage --- packages/nc-gui/components/cell/GeoData.vue | 37 ++++++++++++++++--- .../nc-gui/components/smartsheet/Cell.vue | 2 +- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/cell/GeoData.vue b/packages/nc-gui/components/cell/GeoData.vue index 6d465a6e8f..436e8c585f 100644 --- a/packages/nc-gui/components/cell/GeoData.vue +++ b/packages/nc-gui/components/cell/GeoData.vue @@ -20,6 +20,10 @@ const vModel = useVModel(props, 'modelValue', emits) const activeCell = inject(ActiveCellInj, ref(false)) +const isPublic = inject(IsPublicInj, ref(false)) + +const readonly = inject(ReadonlyInj, ref(false)) + const isExpanded = ref(false) const isLoading = ref(false) @@ -167,19 +171,39 @@ watch( } }, ) + +const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape' && isExpanded.value) { + e.preventDefault() + e.stopImmediatePropagation() + isExpanded.value = false + } + + if (e.key === 'Enter') { + e.preventDefault() + isExpanded.value = !isExpanded.value + } +}