Skip to content

Commit 9dfd980

Browse files
committed
shopfloor_mobile_base: fix searchbar focus
1 parent 232e040 commit 9dfd980

File tree

1 file changed

+9
-1
lines changed
  • shopfloor_mobile_base/static/wms/src/components/searchbar

1 file changed

+9
-1
lines changed

Diff for: shopfloor_mobile_base/static/wms/src/components/searchbar/searchbar.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@ export var Searchbar = Vue.component("searchbar", {
115115
},
116116
methods: {
117117
capture_focus: function () {
118-
if (this.autofocus) this.$refs.searchbar.focus();
118+
if (this.autofocus && this.$refs.searchbar) {
119+
// We need to use both "focus" and "click" in combination
120+
// to make sure that the searchbar is fully focused and ready for scanning
121+
// without having to manually tap on it.
122+
// Using simply one or the other is not enough
123+
// to always be able to input any scanned text.
124+
this.$refs.searchbar.focus();
125+
this.$refs.searchbar.click();
126+
}
119127
},
120128
show_virtual_keyboard: function (elem) {
121129
elem.inputMode = this.input_inputmode;

0 commit comments

Comments
 (0)