Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion POS/src/components/sale/ItemSelectionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
</button>
<div class="flex-1 h-full flex items-center justify-center px-3">
<input
ref="quantityInput"
v-model.number="quantity"
type="number"
min="1"
Expand Down Expand Up @@ -236,7 +237,7 @@
import { DEFAULT_CURRENCY, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { Button, Dialog } from "frappe-ui"
import { createResource } from "frappe-ui"
import { computed, ref, watch } from "vue"
import { computed, nextTick, ref, watch } from "vue"
import TranslatedHTML from "../common/TranslatedHTML.vue"
import { offlineState } from "@/utils/offline/offlineState"
import { getCachedVariants, cacheItems } from "@/utils/offline/items"
Expand Down Expand Up @@ -267,6 +268,7 @@ const options = ref([])
const selectedOption = ref(null)
const quantity = ref(1)
const selectedAttributes = ref({}) // For variant attribute selection
const quantityInput = ref(null)

// Computed properties for dialog customization
const dialogTitle = computed(() => {
Expand Down Expand Up @@ -431,6 +433,11 @@ watch(
if (isOpen && props.item) {
loadOptions()
}
if (isOpen && props.mode === "uom") {
nextTick(() => {
setTimeout(() => { quantityInput.value?.focus(); quantityInput.value?.select() }, 100)
})
}
},
)

Expand Down