Browse Source

fix(gui): arrow navigation issue with single select

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4957/head
Pranav C 2 years ago
parent
commit
cf3620f9a6
  1. 9
      packages/nc-gui/components/cell/SingleSelect.vue

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

@ -189,6 +189,13 @@ const toggleMenu = (e: Event) => {
} }
isOpen.value = editAllowed.value && !isOpen.value isOpen.value = editAllowed.value && !isOpen.value
} }
// prevent propagation of keydown event if select is open
const onKeydown = (e: KeyboardEvent) => {
if (isOpen.value && (active.value || editable.value)) {
e.stopPropagation()
}
}
</script> </script>
<template> <template>
@ -206,7 +213,7 @@ const toggleMenu = (e: Event) => {
:dropdown-class-name="`nc-dropdown-single-select-cell ${isOpen ? 'active' : ''}`" :dropdown-class-name="`nc-dropdown-single-select-cell ${isOpen ? 'active' : ''}`"
:show-search="isOpen && (active || editable)" :show-search="isOpen && (active || editable)"
@select="isOpen = false" @select="isOpen = false"
@keydown.stop @keydown="onKeydown($event)"
@search="search" @search="search"
> >
<a-select-option <a-select-option

Loading…
Cancel
Save