Closed johnridges closed 1 year ago
Unfortunately, there's no way to make the change only for the Android platform, since it's the same compiled output for all platforms.
You can add the lime_enable_html5_ime
define to restore the old behavior, if it helps.
Ignore my earlier comment. I forgot that this was HTML5 target vs. HTML5 target, not HTML5 target vs. Android target.
That said, there should still be a way to detect platform at runtime...
Edit: based on a quick search, how about this?
#if lime_enable_html5_ime
textInput.type = 'text';
#else
if(js.Browser.navigator.userAgent.indexOf("Android") >= 0) {
// use password instead of text to avoid IME issues
textInput.type = 'password';
} else {
textInput.type = 'text';
}
#end
Other than checking user agent, which isn't reliable since it can be changed, I'm not sure that there's a good way to detect Android.
Ideally, we'd figure out how to make IME input work in html5. It's a pretty quirky situation, though, with our hidden HTMLInputElement.
which isn't reliable since it can be changed
So a user can spoof what system they're on to force the app's keyboard behavior to be slightly worse? It should still work for the majority.
Yeah, I guess it's not terrible. I won't argue if you want to implement that.
At least for now, I'd say.
Edit: also, HTML5Window
already uses userAgent
in one other place.
The change in HTML5Window.hx of the Input Element type from 'text' to 'password' (commit e03cc18) has disabled emoji input in Windows (using window-period). This change should only be made for the Android platform.