Skip to content

Commit

Permalink
shopfloor_mobile_base: fix searchbar focus
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Nov 9, 2023
1 parent 232e040 commit 9dfd980
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9dfd980

Please sign in to comment.