From a1bf81aa565b26e1de3a1fbc96ebc2b5eef5d39e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 5 Oct 2023 13:44:08 -0500 Subject: [PATCH] Auto-focus case/unit field when showing inventory count page --- src/components/inventory/ByjoveInventory.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/inventory/ByjoveInventory.vue b/src/components/inventory/ByjoveInventory.vue index dd5aa22..31e84e7 100644 --- a/src/components/inventory/ByjoveInventory.vue +++ b/src/components/inventory/ByjoveInventory.vue @@ -44,13 +44,15 @@ + step="any" + ref="units"> @@ -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() {