This commit is contained in:
parent
185d4f93a7
commit
f5f1cdf0ac
|
@ -259,28 +259,6 @@ async function onScroll({ to, direction, from, index }) {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -291,7 +269,6 @@ function handleKeyDown(event) {
|
|||
:option-value="optionValue"
|
||||
v-bind="$attrs"
|
||||
@filter="filterHandler"
|
||||
@keydown="handleKeyDown"
|
||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||
:map-options="nullishToTrue($attrs['map-options'])"
|
||||
:use-input="nullishToTrue($attrs['use-input'])"
|
||||
|
|
|
@ -208,7 +208,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'vat']"
|
||||
:hide-selected="false"
|
||||
:fill-input="false"
|
||||
:display-value="formatOpt(row, col, 'vat')"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
@ -233,9 +232,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'transaction']"
|
||||
:autofocus="col.tabIndex == 1"
|
||||
input-debounce="0"
|
||||
:hide-selected="false"
|
||||
:fill-input="false"
|
||||
:display-value="formatOpt(row, col, 'transaction')"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
|
Loading…
Reference in New Issue