diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index 74f6fd3cb..bd8edfeeb 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -25,7 +25,6 @@ const sageTaxTypes = ref([]); const sageTransactionTypes = ref([]); const rowsSelected = ref([]); const invoiceInFormRef = ref(); -const expenseRef = ref(); defineProps({ actionIcon: { @@ -139,7 +138,7 @@ function taxRate(invoiceInTax) { return ((taxTypeSage / 100) * taxableBase).toFixed(2); } -function autocompleteExpense(evt, row, col) { +function autocompleteExpense(evt, row, col, ref) { const val = evt.target.value; if (!val) return; @@ -148,7 +147,7 @@ function autocompleteExpense(evt, row, col) { ({ id }) => id == useAccountShortToStandard(param), ); - expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup); + ref.vnSelectDialogRef.vnSelectRef.toggleOption(lookup); } function setCursor(ref) { @@ -156,7 +155,9 @@ function setCursor(ref) { const select = ref.vnSelectDialogRef ? ref.vnSelectDialogRef.vnSelectRef : ref.vnSelectRef; - select.$el.querySelector('input').setSelectionRange(0, 0); + const input = select.$el.querySelector('input'); + input.focus(); + input.setSelectionRange(0, 0); }); } @@ -196,15 +197,24 @@ function setCursor(ref) {