{ "id": "63539", "key": "TIMOB-2907", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11246", "name": "Sprint 2011-11", "archived": true, "released": true, "releaseDate": "2011-03-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:24.000+0000", "created": "2011-04-15T03:32:34.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "defect", "ios", "klist", "quickstart-customer", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T02:00:24.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Below are videos from the latest build SDK 1.6. Using iOS 4.2.\niPad

\n

Textfield focusing and keyboard is a little odd on the iPad:\nhttp://screencast.com/t/Bdc27adj

\n

Doesn't seem to happen on the iPhone (i.e. smaller screen)

\n

The data in the tableview is being set using setData() (on\nfocus). When the optional animation property is set it does really\nfunky things
\n(i.e. setData(data,\n{animationStyle:Titanium.UI.iPhone.RowAnimationStyle.TOP})

\n

\nhttp://www.screencast.com/users/edgar.vos/folders/Jing/media/ceb073...

\n

Tested on the device and sim.

{html}", "attachment": [], "flagged": false, "summary": "iOS / iPad: Focus on Textfields inside a table", "creator": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "environment": null, "comment": { "comments": [ { "id": "129674", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

To reproduce the first video:

\n
\nvar win = Titanium.UI.currentWindow;\n\nvar rows = [];\n\nfor (var i=0; i < 5; i++) {\n    var row = Ti.UI.createTableViewRow();\n\n    var textfield = Ti.UI.createTextField({\n        color:'#336699',\n        height:35,\n        width:300,\n        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\n    });\n\n    row.add(textfield);\n\n    rows.push(row);\n}\n\nvar tableview = Ti.UI.createTableView({\n    data: rows\n});\n\nwin.add(tableview);\n
\n

To reproduce the second video, use the code below. Note: When\nthe textfield is focused, click the set data button - the table\nwill fly out of sight.

\n
\nvar win = Titanium.UI.currentWindow;\n\nvar rows = [];\n\nvar tableview = Ti.UI.createTableView();\n\nfor (var i=0; i < 5; i++) {\n    var row = Ti.UI.createTableViewRow();\n\n    var textfield = Ti.UI.createTextField({\n        color:'#336699',\n        height:35,\n        width:300,\n        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\n    });\n\n    row.add(textfield);\n\n    rows.push(row);\n}\n\nvar button = Ti.UI.createButton({\n    title: 'test',\n    width: 100,\n    height: 50,\n    right: 10,\n    top: 10\n});\n\nbutton.addEventListener('click', function() {\n    setTimeout(function() {\n        tableview.setData(rows, { animationStyle:Titanium.UI.iPhone.RowAnimationStyle.TOP });\n    }, 1000);   \n});\n\nwin.add(tableview);\nwin.add(button);\n
{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:32:35.000+0000", "updated": "2011-04-15T03:32:35.000+0000" }, { "id": "129675", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

To Update This Ticket: Quickstart customer is still having\nissues with this even with the setData()'s second arg not passed or\nset to null. Here's a video of it in action: http://screencast.com/t/toWTDJCmL0oF\n. Pressing 'tab' on the sim or the 'return' button on the sim's\nkeyboard will do this every time. In the video's particular case,\nit's a modal with a 'Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET'\nstyle set to it - however this happens in a normal window as\nwell.

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:32:35.000+0000", "updated": "2011-04-15T03:32:35.000+0000" }, { "id": "129676", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "{html}

I think this is related to an issue I'm seeing with textFields\nin tableViewRows on the iPhone too - which ONLY happens when the\ntableView is in a modal window.

\n

See HelpDesk ticket : http://developer.appcelerator.com/helpdesk/view/76164

\n

And Q&A discussion : \nhttp://developer.appcelerator.com/question/116461/tableview-with-te...

{html}", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2011-04-15T03:32:35.000+0000", "updated": "2011-04-15T03:32:35.000+0000" }, { "id": "129677", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

Here's another code sample to demonstrate the issue. This\nexample simulates the scenario one of our quickstart customer's are\ndoing - resetting the table's data upon return / tab. In our\ncustomer's case they might have additional fields they want to show\nas a user is filling out a form. insertRow() could be used but in\nsome cases the entire table data needs to be reset (using\nsetData()).

\n

You'll notice the first time you hit return it will fly out\nbecause of the new data. Subsequent tries will not cause the table\nto fly out.

\n
\nvar win = Titanium.UI.currentWindow;\n\nvar btn = Ti.UI.createButton({\n    title: 'Button Here',\n    width: 200,\n    height: 100,\n    top: 10\n});\n\nbtn.addEventListener('click', function() {\n    var newwin = Ti.UI.createWindow({\n        title: 'Test',\n        modalTransitionStyle: Ti.UI.iPhone.MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL,\n        modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET,\n        width: 400,\n        height: 600\n    });\n    \n    var rows        = [],\n        tableview   = Ti.UI.createTableView(),\n        row         = Ti.UI.createTableViewRow();\n\n        var textfield = Ti.UI.createTextField({\n            color:'#336699',\n            value: 'Flying tables away',\n            width: 300,\n            height: 35,\n            borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\n        });\n\n        row.add(textfield);\n        rows.push(row);\n        tableview.setData(rows);\n\n    textfield.addEventListener('return', function() {\n        var newrows = [];       \n        for(var i = 0; i < 3; i++) {\n            var newrow = Ti.UI.createTableViewRow();\n\n            var newtextfield = Ti.UI.createTextField({\n                color:'#336699',\n                value: 'Flying tables away',\n                width: 300,\n                height: 35,\n                borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\n            });\n            newrow.add(newtextfield);\n            newrows.push(newrow);           \n        }\n        tableview.setData(newrows);\n    }); \n    \n    newwin.add(tableview);\n    newwin.open({modal: true});\n});\n\nwin.add(btn);\n
{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:32:36.000+0000", "updated": "2011-04-15T03:32:36.000+0000" }, { "id": "129678", "author": { "name": "cedrickastner", "key": "cedrickastner", "displayName": "Cedric Kastner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Not only iPad-related. This happens on iPhone too. See \nTicket #3354 for more details and how to reproduce…

{html}", "updateAuthor": { "name": "cedrickastner", "key": "cedrickastner", "displayName": "Cedric Kastner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:32:36.000+0000", "updated": "2011-04-15T03:32:36.000+0000" }, { "id": "129679", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [f51f1e1a643cfe556882785e9a683698ad704070])\n[#3354 state:fixed-in-qa] [#2907\nstate:fixed-in-qa] It feels good to find a one-liner fix after\ndoing all these deep changes (offset should never be negative)\n\nhttps://github.com/appcelerator/titanium_mobile/commit/f51f1e1a643c...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:32:36.000+0000", "updated": "2011-04-15T03:32:36.000+0000" }, { "id": "129680", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

Tested the latest build on March 17th - This resolves the above\nissues. Great job!

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:32:37.000+0000", "updated": "2011-04-15T03:32:37.000+0000" }, { "id": "129681", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Tested with Titanium SDK version: 1.7.0 (03/18/11 12:00 19be393)\non
\niPad2 4.3

\n

Click on first text field type stuff in and hit enter
\n2 more text field appears and the fields are reset

{html}", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:32:37.000+0000", "updated": "2011-04-15T03:32:37.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }