From 48f58d730d5360e1eb1d8139794e09e6c6a95dfd Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 24 Jan 2023 11:58:49 +0530 Subject: [PATCH 1/7] fix(gui): skip keydown event handler if active cell value is `NaN` Signed-off-by: Pranav C --- packages/nc-gui/composables/useMultiSelect/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 37a350379c..d596e82e84 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -171,7 +171,7 @@ export function useMultiSelect( return true } - if (activeCell.row === null || activeCell.col === null) { + if (activeCell.row === null || activeCell.col === null || isNaN(activeCell.row) || isNaN(activeCell.col)) { return } From a9fec148950eb65aa30917d2d5c57e527e3db110 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 24 Jan 2023 12:17:42 +0530 Subject: [PATCH 2/7] fix(gui): skip expand row behaviour if active row value is NaN or null Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 09a9dd5b36..3a0992c513 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -202,7 +202,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey const altOrOptionKey = e.altKey if (e.key === ' ') { - if (activeCell.row != null && !editEnabled && hasEditPermission) { + if (activeCell.row != null && !isNaN(activeCell.row) && !editEnabled && hasEditPermission) { e.preventDefault() clearSelectedRange() const row = data.value[activeCell.row] From 77ec4c17da1db29a90a47efd9f4daab7ea362010 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 24 Jan 2023 12:41:14 +0530 Subject: [PATCH 3/7] fix(gui): skip ctrl+arrow navigation if active cell is null/NaN Signed-off-by: Pranav C --- .../nc-gui/components/smartsheet/Grid.vue | 338 +++++++++--------- 1 file changed, 169 insertions(+), 169 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 3a0992c513..000b41f034 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -156,8 +156,8 @@ const getContainerScrollForElement = ( relativePos.right + (offset?.right || 0) > 0 ? container.scrollLeft + relativePos.right + (offset?.right || 0) : relativePos.left - (offset?.left || 0) < 0 - ? container.scrollLeft + relativePos.left - (offset?.left || 0) - : container.scrollLeft + ? container.scrollLeft + relativePos.left - (offset?.left || 0) + : container.scrollLeft /* * If the element is below the container, scroll down (positive) @@ -167,8 +167,8 @@ const getContainerScrollForElement = ( relativePos.bottom + (offset?.bottom || 0) > 0 ? container.scrollTop + relativePos.bottom + (offset?.bottom || 0) : relativePos.top - (offset?.top || 0) < 0 - ? container.scrollTop + relativePos.top - (offset?.top || 0) - : container.scrollTop + ? container.scrollTop + relativePos.top - (offset?.top || 0) + : container.scrollTop return scroll } @@ -226,6 +226,8 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell } if (cmdOrCtrl) { + if (activeCell.row === null || isNaN(activeCell.row) || activeCell.col === null || isNaN(activeCell.col)) return + switch (e.key) { case 'ArrowUp': e.preventDefault() @@ -672,105 +674,104 @@ const closeAddColumnDropdown = () => { @contextmenu="showContextMenu" > - - -
- - -
- - -
- + + +
+ + +
+ + -
- +
+ + +
+ + + +
+ +
- -
- - + + + + - - + + + + +
+ - + {{ $t('activity.addRow') }} -
- - +
+ + @@ -897,8 +898,7 @@ const closeAddColumnDropdown = () => {
- +
{{ $t('general.copy') }} From 196e4a5b61571b5a90357a680ba1e11843c2185d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 24 Jan 2023 12:52:24 +0530 Subject: [PATCH 4/7] fix(gui): reload app info after setting license Signed-off-by: Pranav C --- packages/nc-gui/components/account/License.vue | 5 ++++- packages/nc-gui/composables/useGlobal/actions.ts | 11 ++++++++++- packages/nc-gui/composables/useGlobal/types.ts | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/account/License.vue b/packages/nc-gui/components/account/License.vue index a9160edf78..29cd19839b 100644 --- a/packages/nc-gui/components/account/License.vue +++ b/packages/nc-gui/components/account/License.vue @@ -1,12 +1,14 @@