1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Arrow Elastic text areas - text areas the facebook way

    Elastic text areas - text areas the facebook way





    Ext.fc.autoHeightTextArea

    Text Area the facebook way

    About

    Get your text areas to grow/shrink according to content

    Features
    • No endless timer events, height is updated on key press
    • You can define max an min height and height increment for the text area
    • Can be applied directly to a HTML Text Area element, no need to create an Ext.Form.TextArea element

    Demo & Download

    http://www.francodacosta.com/demos/e...eightTextArea/

  2. #2
    Ext JS Premium Member syscobra's Avatar
    Join Date
    Nov 2007
    Location
    Venezuela
    Posts
    140
    Vote Rating
    0
    syscobra is on a distinguished road

      0  

    Default


    Nice addon, i will try it on Ext core to see if it works the same way.
    Haven't tryed yet, but i see in the code it triggers on keyup?, what happens if the default text in the text area is bigger than the textarea?, it resizes too?.
    I mean if i put text in the textarea from lets say a DB and that text is bigger it gets resized too?.

    Thanks for sharing
    Javier Rincón aka SysCobra

  3. #3
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Default


    In my local machine it's working well with Ext 3

    The text box will be resized if the default text is bigger / smaller than the initial text area height

  4. #4
    Ext JS Premium Member
    Join Date
    May 2008
    Location
    Austria, Vienna
    Posts
    213
    Vote Rating
    1
    abraxxa is on a distinguished road

      0  

    Default


    Isn't this the same as the grow attribute textarea has?

  5. #5
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Default


    Quote Originally Posted by francodacosta View Post
    Can be applied directly to a HTML Text Area element, no need to create an Ext.Form.TextArea element
    The main difference is that this extension can be applied directly to an HTML Text Area element also the Ext TextArea has some ugly problems with the scroll bar, just try it and see the scroll bar showing and hiding on each resize

  6. #6
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    neat

    different behaviours on Safari/Chrome and Firefox though.

    in Safari/Chrome, typing an endlessly long string auto-wraps it; when string content height exceeds the height of the textarea, it doesn't grow.

    in Firefox, typing the same endlessly long string doesn't auto-wrap it; textarea grows the moment a space or newline is introduced in the endlessly long string.

  7. #7
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Default


    Thats a browser specific feature, some browsers do not split entire words

    If you type the long string one letter after another it should resize because the resize code is triggered on key up

    I guess an option could be added to allow the textarea to grow/shrink according to text width

  8. #8
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by francodacosta View Post
    Thats a browser specific feature, some browsers do not split entire words
    toe-may-toes, toe-mah-toes. oh well.

    Quote Originally Posted by francodacosta View Post
    If you type the long string one letter after another it should resize because the resize code is triggered on key up
    i did, but no growth.

    Quote Originally Posted by francodacosta View Post
    I guess an option could be added to allow the textarea to grow/shrink according to text width
    that'd be really neat to see. (TextMetrics perhaps?)