[html5] Android System WebView and lime bug with keyboard!
More info here - https://community.openfl.org/t/html5-android-system-webview-and-lime-bug-with-keyboard/14090/9
Hi!
It is continuation of the Android softkeyboard is not appear in my OpenFL/Starling app (html5) 1
I notice that in some cases (not always!) my OpenFL app has a bug in Android System WebView. When I touch to TextField - android keyboard does not appear. In mobile browser there is no such problem. Only in Android System WebView. But it used by many other apps (social networks, messengers, game aggregators, etc) and it is matter for me!
I test it with different versions of Android System WebView (including Dev) - same result. I find that all stuff about it is in \HaxeToolkit\haxe\lib\lime\8,2,2\src\lime_internal\backend\html5\HTML5Window.hx
I try to modify HTML5Window.hx but no result. It is simple to reproduce. Just create TextField in main class:
var input = new TextField(); input.type = TextFieldType.INPUT; input.border = true; input.text = "";
var format = new TextFormat(); format.size = 24; format.font = "Sans"; format.color = 0x101010; input.defaultTextFormat = format; input.needsSoftKeyboard = true;
input.x = 10; input.y = 10; input.width = 200; input.height = 30;
stage.addChild(input); You can see simple project source in zip Click this live demo 1 and check it in Android Web View (copy and open link in Telegram for example).
I have tested other html5 game (not OpenFL) and notice that they create TextArea on full screen width inside div (not TextInput):
May be I don’t understand something or may be it is critical lime bug! Help)
I see strange things as set inputType = “password” for Android only and other.
I explained the reason for setting the type to "password" here:
https://community.openfl.org/t/html5-android-system-webview-and-lime-bug-with-keyboard/14090/2?u=joshtynjala
I don't know why Android's browsers insist on using IME events like "compositionstart" and "compositionend", but when switching the input type to "password", it behaves like more like browsers on iOS, Windows, macOS, and other operating systems and uses the more common "input" event instead. At least for languages like English that don't normally use an IME. Like I said in the thread, it would be strange if a password input didn't display the soft keyboard, so I doubt that makes a difference for the issue that you are experiencing.
I have tested other html5 game (not OpenFL) and notice that they create TextArea on full screen width inside div (not TextInput):
Switching from to
I'm still having difficulty reproducing this issue on my Android devices.
I tested by loading the Feathers UI Login Form sample at https://feathersui.com/samples/haxe-openfl/login-form/ and tapping on one of the text inputs.
First, I emailed myself a link and opened it in the Gmail app. The keyboard appeared correctly, and I could input some text.
I also tried opening the URL in the WebView Test app that I found on the Play Store. It worked there too.
I don't have Telegram, so unfortunately, I cannot test opening a link in that app specifically.
Tested on a Pixel 2 and a Galaxy Tab A.
@joshtynjala this live demo 1 works for you? In Android System WebView?
I’ve created demo2.
<input> works
Only after I focused it - OpenFL TextField starts working too.
Seems there is a problem in lime.
May be lime can create a visible input in place and sizes as a TextField above canvas?
The simplest way to test it - open url in Telegram (it uses Android System WebView).