From 9dfd9803d18b95aef7da6df47dd40773f9b62da5 Mon Sep 17 00:00:00 2001 From: JuMiSanAr Date: Mon, 16 Oct 2023 16:16:03 +0200 Subject: [PATCH 1/2] shopfloor_mobile_base: fix searchbar focus --- .../static/wms/src/components/searchbar/searchbar.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shopfloor_mobile_base/static/wms/src/components/searchbar/searchbar.js b/shopfloor_mobile_base/static/wms/src/components/searchbar/searchbar.js index bed590947f..381f6cb851 100644 --- a/shopfloor_mobile_base/static/wms/src/components/searchbar/searchbar.js +++ b/shopfloor_mobile_base/static/wms/src/components/searchbar/searchbar.js @@ -115,7 +115,15 @@ export var Searchbar = Vue.component("searchbar", { }, methods: { capture_focus: function () { - if (this.autofocus) this.$refs.searchbar.focus(); + if (this.autofocus && this.$refs.searchbar) { + // We need to use both "focus" and "click" in combination + // to make sure that the searchbar is fully focused and ready for scanning + // without having to manually tap on it. + // Using simply one or the other is not enough + // to always be able to input any scanned text. + this.$refs.searchbar.focus(); + this.$refs.searchbar.click(); + } }, show_virtual_keyboard: function (elem) { elem.inputMode = this.input_inputmode; From 3ae9b87a79d0e8f6b6666a641ab8002ee8002205 Mon Sep 17 00:00:00 2001 From: JuMiSanAr Date: Thu, 9 Nov 2023 14:53:36 +0100 Subject: [PATCH 2/2] shopfloor_mobile: ensure searchbar focus doesn't remove user popups --- .../static/wms/src/scenario/cluster_picking.js | 3 +++ .../src/scenario/location_content_transfer.js | 3 +++ .../wms/src/scenario/single_pack_transfer.js | 17 +++++++++++++++-- .../static/wms/src/scenario/zone_picking.js | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/shopfloor_mobile/static/wms/src/scenario/cluster_picking.js b/shopfloor_mobile/static/wms/src/scenario/cluster_picking.js index b85426a68a..b99d3b2c32 100644 --- a/shopfloor_mobile/static/wms/src/scenario/cluster_picking.js +++ b/shopfloor_mobile/static/wms/src/scenario/cluster_picking.js @@ -7,6 +7,8 @@ import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/wms/src/scenario/mixins.js"; import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js"; +// TODO: consider replacing the dynamic "autofocus" in the searchbar by an event. +// At the moment, we need autofocus to be disabled if there's a user popup. const ClusterPicking = { mixins: [ScenarioBaseMixin], template: ` @@ -18,6 +20,7 @@ const ClusterPicking = { v-if="state.on_scan" v-on:found="on_scan" :input_placeholder="search_input_placeholder" + :autofocus="!screen_info.user_popup" /> - - + +