[TIMOB-8637] Android: auto-focuses and shows keyboard for first textfield on Samsung Galaxy Tab on window open or textfield create after window open
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2018-06-30T02:30:09.000+0000 |
Affected Version/s | Release 2.0.0, Release 1.8.1 |
Fix Version/s | n/a |
Components | Android |
Labels | api, parity |
Reporter | Justin Toth |
Assignee | Joshua Quick |
Created | 2012-02-14T10:13:26.000+0000 |
Updated | 2018-06-30T02:31:02.000+0000 |
Description
On a Samsung Galaxy Tab running Android 3.2, if you have a textfield in your window, it will auto set focus to it when either the window is opened or when you create the textfield after the window is opened. This is OK for some situations, such as when you have a form and want it to set focus to the first element by default. However, in other cases, such as when you have a TextField hiding off of the screen and then slide it into view when the user presses a button, it becomes an issue as the keyboard slides up for no reason. Note that it does not set focus to the textfield within the Android emulator.
Here is code to reproduce, which creates the textfield after opening the window.
var win = Ti.UI.createWindow({ backgroundColor: "#fff" });
win.addEventListener("open", function() {
var text = Ti.UI.createTextField({ width: 200, height: 60, top: 20, enabled: false, borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED });
win.add(text);
});
win.open();
And more code, which shows the same behavior when creating the textfield and then opening the window.
var win = Ti.UI.createWindow({ backgroundColor: "#fff" });
var text = Ti.UI.createTextField({ width: 200, height: 60, top: 20, enabled: false, borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED });
win.add(text);
win.open();
Even setting the textfield to enabled: false, it still auto focuses it. At the very least, there should be a property that you can set that will prevent it from auto focusing the textfield. Ideally it should not auto focus the textfield, that way you have the option of focusing it with the textfield.focus(); method yourself.
It's not even consistent. I have a tab view that does not auto focus. But when opening another window with a textfield it does auto focus. It's a serious bug that I cannot translate to my clients.
I no longer see this issue in 2.0.1.GA2, it looks to be fixed...
I am still seeing this issue. SDK: 2.0.1.GA2, 2.0.2.v20120418121806 Studio: 2.0.2.201204201120 OS: Snow Leopard Devices Tested: Galaxy Tab 10.1 3.2 Note: Does not occur on Nexus One 2.2.2, Droid3 2.3.4, Galaxy Nexus 4.0.4, or iOS (parity). The keyboard opens (without permission) when the app first runs. All the previous test code and the code below exhibit the bug behavior.
Device specific
This issue will be resolved by [TIMOB-24138]