Browse Source

fix(gui): skip delete key and toggle options list only if char key pressed

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4459/head
Pranav C 2 years ago
parent
commit
913a3ba800
  1. 22
      packages/nc-gui/components/cell/MultiSelect.vue

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

@ -107,13 +107,13 @@ const selectedTitles = computed(() =>
? typeof modelValue === 'string' ? typeof modelValue === 'string'
? isMysql ? isMysql
? modelValue.split(',').sort((a, b) => { ? modelValue.split(',').sort((a, b) => {
const opa = options.value.find((el) => el.title === a) const opa = options.value.find((el) => el.title === a)
const opb = options.value.find((el) => el.title === b) const opb = options.value.find((el) => el.title === b)
if (opa && opb) { if (opa && opb) {
return opa.order! - opb.order! return opa.order! - opb.order!
} }
return 0 return 0
}) })
: modelValue.split(',') : modelValue.split(',')
: modelValue : modelValue
: [], : [],
@ -175,11 +175,15 @@ useSelectedCellKeyupListener(active, (e) => {
case 'ArrowDown': case 'ArrowDown':
case 'ArrowRight': case 'ArrowRight':
case 'ArrowLeft': case 'ArrowLeft':
case 'Delete':
// skip // skip
break break
default: default:
e.stopPropagation() // toggle only if char key pressed
isOpen.value = true if (e.key?.length === 1) {
e.stopPropagation()
isOpen.value = true
}
break break
} }
}) })

Loading…
Cancel
Save