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

iOS: Text Area in Scroll View in Modal Window Goes offscreen on focus

    Details

      Description

      Description

      When text area inside scroll view, inside modal window, is focused, the scroll view jumps up out of view then settles back down to the correct position above the keyboard. If text is entered the text area does not settle back down above the keyboard. It stays up and out of view. This only happens on device and works fine in simulator.

      Test Case

       
      var win = Ti.UI.createWindow({
      	backgroundColor: '#ccc'
      });
       
      var btn = Ti.UI.createButton({
      	width: Ti.UI.SIZE,
      	height: Ti.UI.SIZE,
      	title: 'Click me!'
      });
       
      win.add(btn);
       
      btn.addEventListener('click', function(e) {
       
      	var w = Ti.UI.createWindow({
      		backgroundColor : 'stripped'
      	});
       
      	var scrollView = Ti.UI.createScrollView({
      		contentHeight: 1000,
      		width: Ti.UI.FILL,
      		height: Ti.UI.FILL
      	});
       
      	var label = Ti.UI.createLabel({
      		text : 'Scroll Down',
      		height : Ti.UI.SIZE,
      		width : Ti.UI.FILL,
      		textAlign : 'center',
      		top: 10
      	});
       
      	var textArea = Ti.UI.createTextArea({
      		left:10,
      		right:10,
      		bottom: 150,
      		height: 100,
      	});
      	var btn = Titanium.UI.createButton({
      		title : 'Close',
      		width: Ti.UI.SIZE,
      		height: Ti.UI.SIZE,
      		bottom: 50
      	});
       
       
      	scrollView.add(label);
      	scrollView.add(textArea);
      	scrollView.add(btn);
       
      	textArea.addEventListener('return', function() {
      		textArea.blur();
      	});
      	
      	w.add(scrollView);
      	w.orientationModes = [
      	Titanium.UI.PORTRAIT,
      	Titanium.UI.LANDSCAPE_LEFT,
      	Titanium.UI.LANDSCAPE_RIGHT
      ];
      	w.open({modal : true});
       
      });
       
      win.open();
      

      To Reproduce

      1. Copy and paste this code into your app.js
      2. Run the app on the device
      3. Click on the button and it will open a modal window
      4. Scroll down and tap in the text area
      5. Type in the text area

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                srahim Sabil Rahim
                Reporter:
                clathrop Carter Lathrop
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration