Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TextArea not accepting new lines via return button

I am having an issue with the use of the TextArea, where I am not able to add a new line via pressing 'return', as pressing 'return' simply blurs the field.

> Here is the code I am using

Any help would be appreciated :)

— asked December 4th 2010 by Matt Apperson
  • iphone
0 Comments

2 Answers

  • Accepted Answer

    Set this to the textarea:

    suppressReturn:false
    
    — answered December 4th 2010 by Dan Tamas
    permalink
    2 Comments
    • works perfectly thanks!

      — commented February 21st 2013 by Gaurav DCosta
    • golden!

      — commented July 4th 2013 by Joseph Sachs
  • Hi Matt

    Using textarea.js as a starting point, I commented out some of the createTextArea properties to enable the return key to function the way you intend (ie create a new line):

    var ta1 = Titanium.UI.createTextArea({
        value:'I am a textarea',
        height:70,
        width:300,
        top:60,
        font:{fontSize:20,fontFamily:'Marker Felt', fontWeight:'bold'},
        color:'#888',
        textAlign:'left',
    //    appearance:Titanium.UI.KEYBOARD_APPEARANCE_ALERT,    
    //    keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,
    //    returnKeyType:Titanium.UI.RETURNKEY_EMERGENCY_CALL,
        borderWidth:2,
        borderColor:'#bbb',
        borderRadius:5,
        suppressReturn:false
    });
    

    Hope this helps.

    — answered December 4th 2010 by Paul Dowsett
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.