[TIMOB-2907] iOS / iPad: Focus on Textfields inside a table
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:00:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-11 |
Components | iOS |
Labels | defect, ios, klist, quickstart-customer, reported-1.6.0 |
Reporter | Rick Blalock |
Assignee | Ralf Pfeiffer |
Created | 2011-04-15T03:32:34.000+0000 |
Updated | 2011-04-17T02:00:24.000+0000 |
Description
Below are videos from the latest build SDK 1.6. Using iOS 4.2. iPad
Textfield focusing and keyboard is a little odd on the iPad: http://screencast.com/t/Bdc27adj">http://screencast.com/t/Bdc27adj
Doesn't seem to happen on the iPhone (i.e. smaller screen)
The data in the tableview is being set using setData() (on
focus). When the optional animation property is set it does really
funky things
(i.e. setData(data,
{animationStyle:Titanium.UI.iPhone.RowAnimationStyle.TOP})
http://www.screencast.com/users/edgar.vos/folders/Jing/media/ceb073b8-5362-4ae4-b9ea-12b280e9ed2e"> http://www.screencast.com/users/edgar.vos/folders/Jing/media/ceb073...
Tested on the device and sim.
To reproduce the first video:
To reproduce the second video, use the code below. Note: When the textfield is focused, click the set data button - the table will fly out of sight.
To Update This Ticket: Quickstart customer is still having issues with this even with the setData()'s second arg not passed or set to null. Here's a video of it in action: http://screencast.com/t/toWTDJCmL0oF">http://screencast.com/t/toWTDJCmL0oF . Pressing 'tab' on the sim or the 'return' button on the sim's keyboard will do this every time. In the video's particular case, it's a modal with a 'Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET' style set to it - however this happens in a normal window as well.
I think this is related to an issue I'm seeing with textFields in tableViewRows on the iPhone too - which ONLY happens when the tableView is in a modal window.
See HelpDesk ticket : http://developer.appcelerator.com/helpdesk/view/76164">http://developer.appcelerator.com/helpdesk/view/76164
And Q&A discussion : http://developer.appcelerator.com/question/116461/tableview-with-textfields-moving-in-160"> http://developer.appcelerator.com/question/116461/tableview-with-te...
Here's another code sample to demonstrate the issue. This example simulates the scenario one of our quickstart customer's are doing - resetting the table's data upon return / tab. In our customer's case they might have additional fields they want to show as a user is filling out a form. insertRow() could be used but in some cases the entire table data needs to be reset (using setData()).
You'll notice the first time you hit return it will fly out because of the new data. Subsequent tries will not cause the table to fly out.
Not only iPad-related. This happens on iPhone too. See https://appcelerator.lighthouseapp.com/projects/32238/tickets/3354-textview-within-tableviewrow-scrollingjumping-when-focussed"> Ticket #3354 for more details and how to reproduce…
(from [f51f1e1a643cfe556882785e9a683698ad704070]) [#3354 state:fixed-in-qa] [#2907 state:fixed-in-qa] It feels good to find a one-liner fix after doing all these deep changes (offset should never be negative) https://github.com/appcelerator/titanium_mobile/commit/f51f1e1a643cfe556882785e9a683698ad704070"> https://github.com/appcelerator/titanium_mobile/commit/f51f1e1a643c...
Tested the latest build on March 17th - This resolves the above issues. Great job!
Tested with Titanium SDK version: 1.7.0 (03/18/11 12:00 19be393) on
iPad2 4.3
Click on first text field type stuff in and hit enter
2 more text field appears and the fields are reset