Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17404] iOS: Focusing TextField in HeaderView of empty TableView causes application to crash on iOS7.1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-01-12T16:11:04.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 4.0.0
ComponentsiOS
LabelsTCSupport, supportTeam
ReporterTomasz Krzywda
AssigneeJon Alter
Created2014-07-10T09:07:49.000+0000
Updated2015-03-31T17:34:58.000+0000

Description

Problem Description

Focusing TextField in HeaderView of empty TableView causes application to crash on iOS7.1

TEST ENVIRONMENT:

Ti SDK 3.3.0.GA Ti CLI 3.3.0 iOS SDK: 7.1 iOS iPhone Simulator: 7.1

STEP TO REPRODUCE:

1. Create a default alloy project. 2. Replace index.xml with the following code:

<Alloy>
    <Window id="win" backgroundColor="white">
        <TableView id="table">
        	<HeaderView>
            <TextField
            platform="ios"
            borderStyle="Ti.UI.INPUT_BORDERSTYLE_BEZEL"
            keyboardToolbarColor="#999" keyboardToolbarHeight="40"
            top="10" height="35" width="300"
            value="Focus to see keyboard with toolbar">

            <!-- Sets the keyboardToolbar property -->
            <KeyboardToolbar>
                <Toolbar>
                    <Items>
                        <Button systemButton="Ti.UI.iPhone.SystemButton.CANCEL" />
                        <FlexSpace/>
                        <Button systemButton="Ti.UI.iPhone.SystemButton.CAMERA" />
                        <FlexSpace/>
                        <Button style="Ti.UI.iPhone.SystemButtonStyle.DONE">Send</Button>
                    </Items>
                </Toolbar>
            </KeyboardToolbar>
        	</TextField>
        	</HeaderView>
        </TableView>
    </Window>
</Alloy>

3. Launch the app. Click on the TextFielfd to write. 4. The keyboard pops up and the application crushes

EXPECTED RESULT

Keyboard should open to enable writing in the TextField.

OBSERVED RESULT

After the Keyboard opens the application crashes.

Attachments

FileDateSize
.log2014-07-10T09:07:53.000+00001460086
console.log2014-07-10T09:08:02.000+00008077
diagnostic119268309622987192.log2014-07-10T09:08:00.000+000015646
index.xml2014-07-10T09:08:03.000+0000479

Comments

  1. Mauro Parra-Miranda 2014-07-28

    Thanks for your report! The Platform team will set the priority on this bug.
  2. Jon Alter 2015-01-05

    PR: https://github.com/appcelerator/titanium_mobile/pull/6535 Test case (Same as above, but more simple)
       var win = Ti.UI.createWindow({
           backgroundColor: 'white'
       });
       win.open();
       
       var textField = Ti.UI.createTextField({
           borderStyle: Ti.UI.INPUT_BORDERSTYLE_BEZEL,
           keyboardToolbarColor: "#999",
           keyboardToolbarHeight: "40",
           top: "10", height: "35", width: "300",
           value:"Focus to see keyboard with toolbar",
       });
       var table = Ti.UI.createTableView({
           headerView: textField
       });
       
       win.add(table);
       
  3. Vishal Duggal 2015-01-06

    Additional Test Case
       var win = Ti.UI.createWindow({
           backgroundColor: 'white',
           orientationModes:[1,2,3,4]
       });
       win.open();
        
       var textField = Ti.UI.createTextField({
           borderStyle: Ti.UI.INPUT_BORDERSTYLE_BEZEL,
           keyboardToolbarColor: "#999",
           keyboardToolbarHeight: "40",
           top: "10", height: "35", width: "300",
           value:"Focus to see keyboard with toolbar",
       });
       
       var theHeader = Ti.UI.createLabel({
       	height:200,
       	width:Ti.UI.FILL,
       	text:'HEADER',
       	backgroundColor:'red'
       })
       
       var table = Ti.UI.createTableView({
       		headerView: theHeader,
           footerView: textField,
           height:200,
           borderWidth:1,
           borderColor:'black'
       });
        
       win.add(table);
       
  4. Vishal Duggal 2015-01-12

    PR merged
  5. Ewan Harris 2015-01-19

    Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.6.0.v20150119054128 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 Plus (8.1.1), iPad Mini 2 (7.0.3) Using both the Alloy and classic code built to both devices, code no longer crashes when focusing on the textfield. Closing ticket.

JSON Source