Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5300 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    jared.rodriguez is on a distinguished road

      0  

    Default TextArea with grow sizes incorrectly based on the value of the TextArea

    TextArea with grow sizes incorrectly based on the value of the TextArea


    If the user types something into the text area that has a tag that can render as HTML, then the sizer is all screwy.

    For instance, the user types the following into the text area:

    I am < Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquet accumsan nunc, eget luctus arcu aliquam sit amet. Etiam feugiat quam eget nisi fringilla at fringilla neque consequat. Proin nisl nisl, rutrum ut cursus consequat, posuere quis lorem. Donec massa ligula, tempus quis placerat vel, bibendum a ligula. Sed nibh nulla, fermentum at fringilla eu, molestie vel nulla. Sed quam justo, auctor eget hendrerit et, mollis et libero. Duis ac ipsum mi, ac malesuada neque. but am > 7
    Then only 7 characters are processed for length as everything between the < and > are ignored.

    A good fix would be to change Ext.layout.component.field.TextArea where it pulls the value from the input element. That value is already processed by the adjustForGrow routine to replace line feeds with <br/>. Additional processing to replace the < and > characters would fix the problem.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What Ext JS 4 version are you seeing this in and what browser? Just tested in Chrome with out latest code and the textarea grows as expected.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    9
    Vote Rating
    0
    jkennedy is on a distinguished road

      0  

    Default


    EXT 4.0.7 and Chrome 16.0.912.77

    It depends what you type to get the grow to not work. If you have a bunch of text within a <> then it will not grow appropriately. My example might have been off, the content between the <> in my case has no white space, which could make the difference.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This produced this bug:

    I am <Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquet accumsan nunc, eget luctus arcu aliquam sit amet. Etiam feugiat quam eget nisi fringilla at fringilla neque consequat. Proin nisl nisl, rutrum ut cursus consequat, posuere quis lorem. Donec massa ligula, tempus quis placerat vel, bibendum a ligula. Sed nibh nulla, fermentum at fringilla eu, molestie vel nulla. Sed quam justo, auctor eget hendrerit et, mollis et libero. Duis ac ipsum mi, ac malesuada neque. but am> 7
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,997
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I can see how that makes sense. It sends the text off to TextMetrics to measure it, which could cause problems if the markup is invalid.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Sencha User
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    jared.rodriguez is on a distinguished road

      0  

    Default


    My fix was to add the following lines to Ext.layout.component.field.TextArea


    value = value.replace (/</g, '_');
    value = value.replace (/>/g, '_');

    I put them right before the existing line of:


    value = value.replace(/\n/g, '<br>');