diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index b9c6edf50..7a7c341a6 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -379,7 +379,7 @@ function handleScroll() { :name="col.orderBy ?? col.name" :data-key="$attrs['data-key']" :search-url="searchUrl" - :vertical="true" + :vertical="false" /> ($props.useLike ? { like: `%${val}%` } : val); defineExpose({ opts: myOptions }); + +function handleKeyDown(event) { + if (event.key === 'Tab') { + event.preventDefault(); + + const inputValue = vnSelectRef.value?.inputValue; + + if (inputValue) { + const matchingOption = myOptions.value.find( + (option) => + option[optionLabel.value].toLowerCase() === inputValue.toLowerCase() + ); + + if (matchingOption) { + emit('update:modelValue', matchingOption[optionValue.value]); + } else { + emit('update:modelValue', inputValue); + } + vnSelectRef.value?.hidePopup(); + } + } +}