Safari for iOS does not trigger keyboard events on DOM elements that are not form components. This includes the document and body, which are commonly used to capture keystrokes on any page.
The only way to trigger a keypress event on a document or page body is to call it in an input or text field. In this case, the event will correctly βbubbleβ with the body and the document.
However, this can be a problem because Safari for iOS does not allow us to select an element from javascript.
We are currently using a solution in which the user needs to click on the input field before starting the first scan, and then the input field will be moved off the screen, but focus will remain.
If anyone has a better solution, share it.
MiloΕ‘ RaΕ‘iΔ
source share