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

Android: Tableview:Softkeyboard hiding on blur event call depends on number of rows in tableview

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 2.1.0, Release 3.1.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      Tested with Titanium SDK: 2.1.0.v20120621184154
      Tested with Titanium  Studio: 2.1.0.201206211609
      Device - Android 2.2.2 LG-P970,Android 3.2 samsung galaxy tab 620,Android 4.0.2 samsung galaxy nexus
      Machine OS - MAC 10.7.3

      Description

      This is not a regression.It exists as far as 1.8.2

      Steps to reproduce:
      1) Use the code below:

      var win=Titanium.UI.createWindow();
      win.backgroundColor='red';
      var tf1 = null;
       
      		function addRow() {
      			var row = Ti.UI.createTableViewRow({
      				backgroundColor: "#000",
      				height : 80
      			});
      			
      			tf1 = Titanium.UI.createTextField({
      				backgroundColor: "#fff",
      				width : 250,
      				height : 80,
      				focusable : true,
      				returnKeyType : Titanium.UI.RETURNKEY_DONE,
      				autocorrect : false,
      				suppressReturn : true,
      			});
      			
      			tf1.addEventListener('focus', function() {
      				alert('Focus fired');
      			});
      			row.add(tf1);
      			return row;
      		}
      		
      		var data = [];
      		
      		for(var x = 0; x < 20; x++) {
      			data[x] = addRow();
      		}
      		
      		var tableView = Ti.UI.createTableView({
      			data : data,
      		});
      		Ti.Gesture.addEventListener('orientationchange',function(){
      			tf1.blur();
      			alert('blur fired');
      		})
      		win.add(tableView);
      		win.open();
      

      2) Run the app in portrait mode.
      3) Click on any row of the tableview.
      4) Click ok on the focus alert and rotate the device to landscape mode.
      5) Click ok on the blur event and click on any row of the tableview.
      6) Click ok on the focus alert and rotate the device back to portrait mode.

      Expected result:
      2) After step 2, app should be running with tableview shown along with 10 rows.
      3) 'Focus fired' alert and soft keyboard should be displayed.
      4) 'Blur fired' alert should be displayed and soft keyboard should be hidden.
      5) 'Focus fired' alert and soft keyboard should be displayed.
      6) 'Blur fired' alert should be displayed and soft keyboard should be hidden.

      Actual result:
      2) After step 2, app gets running with tableview shown along with 10 rows.
      3) 'Focus fired' alert and soft keyboard gets displayed.
      4) 'Blur fired' alert is displayed and soft keyboard gets hidden.
      5) 'Focus fired' alert and soft keyboard gets displayed.
      6) 'Blur fired' alert is displayed and soft keyboard is not hidden.

      When the number of rows get out of screen,keyboard stops hiding on blur event call.If number of rows are kept like under 5,softkeyboard gets hide as expected.

      Particular issue -
      In above code, replace
      var win=Titanium.UI.createWindow();
      win.backgroundColor='red';

      with

      var win = Ti.UI.createWindow(

      { softInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : '', windowSoftInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : '' }

      );
      Now portrait to landscape orientationchange will always hide the softkeyboard,but landscape to portrait would not hide it for larger(say >20) no. of rows.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sbhadauria Shyam Bhadauria
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code