From 21c0be04a25b9dda97e91f280a9332273b246885 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 28 Nov 2022 13:27:35 +0800 Subject: [PATCH] fix(nc-gui): return if expanded form is active for Enter & Escape on date picker --- packages/nc-gui/components/cell/DatePicker.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index 2457dae686..3dcda31042 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -76,6 +76,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { case 'Enter': e.stopPropagation() + // if expanded form is active skip resetting the active cell + if (document.querySelector('.nc-drawer-expanded-form.active')) { + return + } if (!open.value) { // open date picker open.value = true @@ -89,6 +93,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { } break case 'Escape': + // if expanded form is active skip resetting the active cell + if (document.querySelector('.nc-drawer-expanded-form.active')) { + return + } if (open.value) { e.stopPropagation() open.value = false