Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12988

iOS: Calling focus() on the next text field causes the parent scroll view to bounce on iPad 1 only

    Details

      Description

      Problem description
      When calling focus() on the next text field in a vertical layout, the parent scroll view bounces instead of smoothly transitioning to the next field. It works fine on other devices e.g. iPad 3 and iOS simulator.

      Test case

      var win1 = Titanium.UI.createWindow({
      	title : 'Tab 1',
      	backgroundColor : '#fff'
      });
       
      var scrollContainer = Ti.UI.createScrollView({
      	height : Ti.UI.SIZE,
      	layout : "vertical",
      	left : 10,
      	right : 10,
      	bottom : 0
      });
       
      var formContainer = Ti.UI.createView({
      	backgroundColor : "#fff",
      	height : Ti.UI.SIZE,
      	width : Ti.UI.FILL,
      	layout : "vertical",
      	top : 7,
      	left : 0,
      	right : 0,
      	bottom : 7,
      	borderWidth : 1,
      	borderColor : '#000'
      });
      scrollContainer.add(formContainer);
       
      var getTextFieldRow = function(arg) {
       
      	var nameField = Titanium.UI.createTextField({
      		id : arg.id,
      		hintText : "ID: " + arg.id,
      		color : '#444',
      		font : {
      			fontSize : 12,
      			fontFamily : 'Helvetica Neue'
      		},
      		height : 35,
      		width : 262,
      		paddingLeft : 6,
      		suppressReturn : false,
      		returnKeyType : Titanium.UI.RETURNKEY_NEXT,
      		borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
      	});
       
      	return nameField;
      }
      var textFields = [];
      for (var i = 0; i < 30; i++) {
      	textFields.push(getTextFieldRow({
      		id : i
      	}));
      }
       
      for (var i = 0; i < textFields.length; i++) {
      	textFields[i].addEventListener('return', function(e) {
      		if (e.source.id + 1 < textFields.length) {
      			textFields[e.source.id + 1].focus();
      		}
      	});
      	formContainer.add(textFields[i]);
      }
       
      win1.add(scrollContainer);
      win1.open();
      

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              dsefton Daniel Sefton
              Reviewer:
              Sabil Rahim
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15832
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration