I created a webview (Android) for our site. I put the input in autofocus:
<input name="barcode"
type="search"
placeholder="Scan Barcode"
class="form-control"
autocomplete="off"
autofocus
required>
When the page is loaded the input is selected but the keyboard of Android does not open => Perfect
But when I focus on this input the android keyboard opens and I do not want it to open because this input is only used to scan barcodes
So I would like to "simulate" an autofocus when closing a modal (for example) rather than a simple focus, how to do?
$('.modal').on('hidden.bs.modal', function (e) {
$("input[name='barcode']").focus();
});
EDIT : More details :
We use these scannettes to access our intranet site :
On the page in question there is only one input, the goal is to enter the input without opening the android keyboard in order to scan a bar code (they are then sent to the database)