Browse Source

fix: add event handler based activeCell status

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5977/head
Pranav C 2 years ago
parent
commit
539f0c2e95
  1. 6
      packages/nc-gui/components/cell/MultiSelect.vue
  2. 6
      packages/nc-gui/components/cell/SingleSelect.vue

6
packages/nc-gui/components/cell/MultiSelect.vue

@ -48,11 +48,11 @@ const readOnly = inject(ReadonlyInj)!
const isEditable = inject(EditModeInj, ref(false))
const _active = inject(ActiveCellInj, ref(false))
const activeCell = inject(ActiveCellInj, ref(false))
// use both ActiveCellInj or EditModeInj to determine the active state
// since active will be false in case of form view
const active = computed(() => _active.value || isEditable.value)
const active = computed(() => activeCell.value || isEditable.value)
const isPublic = inject(IsPublicInj, ref(false))
@ -180,7 +180,7 @@ watch(isOpen, (n, _o) => {
}
})
useSelectedCellKeyupListener(active, (e) => {
useSelectedCellKeyupListener(activeCell, (e) => {
switch (e.key) {
case 'Escape':
isOpen.value = false

6
packages/nc-gui/components/cell/SingleSelect.vue

@ -42,11 +42,11 @@ const readOnly = inject(ReadonlyInj)!
const isEditable = inject(EditModeInj, ref(false))
const _active = inject(ActiveCellInj, ref(false))
const activeCell = inject(ActiveCellInj, ref(false))
// use both ActiveCellInj or EditModeInj to determine the active state
// since active will be false in case of form view
const active = computed(() => _active.value || isEditable.value)
const active = computed(() => activeCell.value || isEditable.value)
const aselect = ref<typeof AntSelect>()
@ -119,7 +119,7 @@ watch(isOpen, (n, _o) => {
}
})
useSelectedCellKeyupListener(active, (e) => {
useSelectedCellKeyupListener(activeCell, (e) => {
switch (e.key) {
case 'Escape':
isOpen.value = false

Loading…
Cancel
Save