Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9041] Android: Auto Tabbing using Next Key is working only in vertical direction and horizontal direction text fields are skipped.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-05-15T15:05:23.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsapi
ReporterNikhil Sharma
AssigneeHieu Pham
Created2012-05-07T18:35:08.000+0000
Updated2017-03-09T23:28:10.000+0000

Description

Auto Tabbing using Next Key is working only in vertical direction and horizontal direction text fields are skipped. Android native properties must be included so that textfields can use 'android:nextFocusLeft' or 'android:nextFocusDown'.

Repo Steps

1.Run the below code in your app.js 2.Click on the first textfield and press the next key of the keyboard. Auto tabbing is working only in vertical direction and horizontal direction text fields are skipped.
Titanium.UI.setBackgroundColor('#000');

var win = Ti.UI.createWindow({
	exitOnClose : true,
	fullscreen : true,
	backgroundColor : '#ffffff'
});
var nf = Ti.UI.createTextField({
	height:40,
	top:57,
	left:105,
	width:144,
	backgroundColor: 'yellow',
	autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
	keyboardType: Titanium.UI.KEYBOARD_DEFAULT
});

win.add(nf);          
 
 
 var yearField = Ti.UI.createTextField({
            height :   40,       
            top :   120,   
            left :   103,
            width :   54,
 backgroundColor: 'red',            
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
        });
        win.add(yearField);

        var monthField = Ti.UI.createTextField({
        height :   40,
            top :   120,
            left :   173,
            width :   37,
 backgroundColor: 'green',
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
        });
        win.add(monthField);

        var dateField = Ti.UI.createTextField({
        height :   40,
            top :   120,
            left :   229,
            width :   37,
 backgroundColor: 'blue',
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
        });
        win.add(dateField);

        var usernameField = Ti.UI.createTextField({
        height :   40,
            top :   153,
            left :   105,
            width :   144,
 
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_DEFAULT,
        });
        win.add(usernameField);

        var passwordField = Ti.UI.createTextField({
        height :   40,    
            top :   205,
            left :   105,
            width :   144,
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            passwordMask : true,
            keyboardType : Titanium.UI.KEYBOARD_DEFAULT,

        });
        win.add(passwordField);

        var repasswordField = Ti.UI.createTextField({
        height :   40,
            top :   255,
            left :   105,
            width :   144,
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            passwordMask : true,
            keyboardType : Titanium.UI.KEYBOARD_DEFAULT,
        });
        win.add(repasswordField);

        var letterField = Ti.UI.createTextField({
        height :   40,
            top :   286,
            left :   105,
            width :   144,
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_DEFAULT,
        });
        win.add(letterField);

        var numberField = Ti.UI.createTextField({
        height :   40,
            top :   320,
            left :   105,
            width :   48,
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
        });
        win.add(numberField);

        var numberField1 = Ti.UI.createTextField({
        height :   40,
            top :   320,
            left :   165.5,
            width :   48,
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
        
        });
        win.add(numberField1);

        var numberField2 = Ti.UI.createTextField({
        height :   40,
            top :   320,
            left :   225,
            width :   49,              
            autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,

        });
        win.add(numberField2);
win.open();

Comments

  1. Hieu Pham 2012-05-15

    This is native behavior on Android. The "next" key is wired to search for the next focusable textfield in the down direction (focusSearch(FOCUS_DOWN), in other words). Here are a couple articles regarding this: http://stackoverflow.com/questions/5048586/can-you-set-tab-order-in-xml-layout http://code.google.com/p/android/issues/detail?id=3148
  2. Hieu Pham 2012-05-15

    Also tested by creating a similar native Android app to compare the behavior. Marking bug as Won't Fix.
  3. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source