Auto-focus case/unit field when showing inventory count page

This commit is contained in:
Lance Edgar 2023-10-05 13:44:08 -05:00
parent 8c6fe828ad
commit a1bf81aa56

View file

@ -44,13 +44,15 @@
<b-input v-model="row.cases"
type="number"
step="any"
ref="cases"
:disabled="!shouldAllowCases()">
</b-input>
</b-field>
<b-field label="Units" expanded>
<b-input v-model="row.units"
type="number"
step="any">
step="any"
ref="units">
</b-input>
</b-field>
</b-field>
@ -100,6 +102,16 @@ export default {
this.fetch(this.$route.params.uuid)
},
updated() {
this.$nextTick(() => {
if (this.shouldAllowCases()) {
this.$refs.cases.focus()
} else {
this.$refs.units.focus()
}
})
},
methods: {
getIndexUrl() {