I'm attempting to build a very simple app that displays a webview to a site which contains a field to input product upc information. Only reason for the app is to provide our warehouse employees with a built in barcode scanner feature. All works well so far, up to inserting the scanned barcode information into the textfield with the following code:

webView.evaluateJavaScript("document.activeElement.value='\(text)'")

The problem I've run into is I am trying to code a way for the form to submit/search immediately following scan. As of now, the Search button does not even appear as using the value property does not seem to register as text input.

I have searched (perhaps incorrectly) for hours online for a similar issue and the only resolve I can think of is simulating keypresses with the textfield focused. At best, a simple keypress for the Enter key. However, with the search button not appearing until text is actually typed on the onscreen keyboard, I'm wondering if a combination of Space/Delete keys are needed, followed by the Enter key. So far, nothing has worked and I'd love some suggestions on what approach should be used here.