Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2501] Android: UI.KEYBOARD_NUMBERS_PUNCTUATION constant causes return to be suppressed

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T22:46:20.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi
ReporterPaul Dowsett
AssigneeIngo Muschenetz
Created2011-04-15T03:21:24.000+0000
Updated2017-06-07T22:46:20.000+0000

Description

Tested on android 1.4.X and 1.5.X, the following code demonstrates that return is suppressed if keyboardType:Ti.UI.KEYBOARD_NUMBERS_PUNCTUATION is set. If you comment out this line, the correct, default behaviour (where a new line is inserted when return is pressed) is observed.

var win = Ti.UI.createWindow({  
    backgroundColor:'white',
    navBarHidden:false,
    title:'This is window 1'
});

var ta1 = Titanium.UI.createTextArea({
    value:'I am a textarea',
    height:70,
    width:300,
    keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,  // problem
    top:10
});
win.add(ta1);

var l = Titanium.UI.createLabel({
    text:'Text area tests.',
    font:{fontSize:14},
    left:10,
    top:100,
    width:300,
    height:'auto'
});
win.add(l);

ta1.addEventListener('change',function(e)
{
    l.text = 'change fired, value = ' + e.value;
});

win.open();

Note that other constants don't seem to cause the same issue, for example keyboardType:Ti.UI.KEYBOARD_ASCII, although I haven't tested them all.

Comments

  1. Junaid Younus 2012-08-23

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120821095711, issue still valid.
  2. Lee Morris 2017-06-07

    Closing ticket due to the time passed and lack of progress.

JSON Source