Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2165] iOS: Modal window crashes app when calling win.close method while keyboard is open

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2013-05-03T18:53:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterVitr
AssigneeMauro Parra-Miranda
Created2013-05-03T11:44:20.000+0000
Updated2016-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();
};

Comments

  1. Daniel Sefton 2013-05-03

    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!

JSON Source