Browse Source

fix(gui): skip ctrl+arrow navigation if active cell is null/NaN

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4917/head
Pranav C 2 years ago
parent
commit
77ec4c17da
  1. 8
      packages/nc-gui/components/smartsheet/Grid.vue

8
packages/nc-gui/components/smartsheet/Grid.vue

@ -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()
@ -674,8 +676,7 @@ const closeAddColumnDropdown = () => {
<thead ref="tableHead">
<tr class="nc-grid-header border-1 bg-gray-100 sticky top[-1px]">
<th data-testid="grid-id-column">
<div class="w-full h-full bg-gray-100 flex min-w-[70px] pl-5 pr-1 items-center"
data-testid="nc-check-all">
<div class="w-full h-full bg-gray-100 flex min-w-[70px] pl-5 pr-1 items-center" data-testid="nc-check-all">
<template v-if="!readOnly">
<div class="nc-no-label text-gray-500" :class="{ hidden: selectedAllRecords }">#</div>
<div
@ -897,8 +898,7 @@ const closeAddColumnDropdown = () => {
</div>
</a-menu-item>
<a-menu-item v-if="contextMenuTarget" data-testid="context-menu-item-copy"
@click="copyValue(contextMenuTarget)">
<a-menu-item v-if="contextMenuTarget" data-testid="context-menu-item-copy" @click="copyValue(contextMenuTarget)">
<div v-e="['a:row:copy']" class="nc-project-menu-item">
<!-- Copy -->
{{ $t('general.copy') }}

Loading…
Cancel
Save