[AC-2165] iOS: Modal window crashes app when calling win.close method while keyboard is open
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2013-05-03T18:53:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Vitr |
Assignee | Mauro Parra-Miranda |
Created | 2013-05-03T11:44:20.000+0000 |
Updated | 2016-03-08T07:41:09.000+0000 |
Description
*Problem description*
I have a view (index) that opens another modal view (settingsWindow) that contains some labels and textfields. When the cursor is in one of the textfields (i.e. the keyboard is shown) and I close the window (win.close()), then the app crashes after a short moment (without any error information in the console). If I blur all textfields first, to make the keyboard disappear, then the app does not crash!
*settingsWindow.xml*
<Alloy>
<Window id="settingsWin" modal="true">
<LeftNavButton id="leftNavButton">
<Button id="cancelButton" onClick="cancelButtonClicked"></Button>
</LeftNavButton>
<RightNavButton>
<Button id="okButton" onClick="okButtonClicked"></Button>
</RightNavButton>
<ScrollView>
<Label id="serverIpLabel">Server IP/Name:</Label>
<TextField id="serverIpTextField" hintText="e.g. 192.168.0.1" onChange="inputChanged" />
</ScrollView>
</Window>
</Alloy>
*settingsWindow.js*
function okButtonClicked() {
$.settingsWin.close();
}
function cancelButtonClicked() {
$.settingsWin.close();
}
*index.js*
function settingsButtonClicked() {
var settingsWin = Alloy.createController('settingsWindow').getView();
settingsWin.open();
};
Hi Vitr, Please make sure the test case you provided is droppable and runnable. Your settigsWindow.xml contained several ellipsis for example, and there's no index code with a button to open the modal window. Please go through the process of creating a new alloy project, dropping in the code you provided, and providing all the necessary code here. Thanks!