Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1031869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:59:50+00:00 2026-05-16T13:59:50+00:00

i am using YUI 3.1 Library from Yahoo and also the TextExpander to let

  • 0

i am using YUI 3.1 Library from Yahoo and also the TextExpander to let a TextArea to grow up when a user type.

The code below initialize the TextArea:

YUI({gallery: 'gallery-2010.03.23-17-54'
    }).use("node", 'gallery-text-expander', function(Y) {
    Y.one('#myTextArea').plug(Y.TextExpander);
});

It’s work perfectly but now i have a question in this scenario:

1) The user type, the TextArea grow up for many rows and then the message is post to the server.

2) After the post, i clean the TextArea with $('myTextArea').value='' but it’s not shrink as expected and still have many rows when in real must back to the original size.

I notice inside the code of the TextExpander (http://yuilibrary.com/gallery/buildtag/text-expander/gallery-2010.03.23-17-54) exist a method called “shrink_area” but how i can call this method
$('myTextArea').shrink_area() ?
(i know is a wrong line of code but i need to obtain something like this) or what is the best way ?

Thanks in advance for the suggestions and tips.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T13:59:51+00:00Added an answer on May 16, 2026 at 1:59 pm

    Oh well i solved the problem myself.

    So instead to try to call the internal method of the plugged class (that was nice to know how to do, probably using a custom namespace) i wrote a little function that do the trick.

    1) first of all i set the CSS property min-height in the class

    2) after clear the TextArea i set the height as the min-height

    the code below shown the function that do the trick

    function shrinkTextArea(element) {
        // clear
        $(element).value ='';
    
        // shrink
        $(element).style.height = $(element).style.minHeight;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many might have had experience using File Upload widget from Yahoo User Interface library
I'm moving some code from YUI to javascript and some of it is using
I'm currently using the Yahoo YUI javascript library in a couple of my projects.
I am currently using YUI datatable, but it is buggy: http://developer.yahoo.com/yui/datatable/ Is there another
I am using YUI's datatable ( http://developer.yahoo.com/yui/datatable/ ) to make a table. But notice
I'm currently using the Rich Text Editor from the YUI framework. But I don't
I'm using Yahoo's Minifier here: http://refresh-sf.com/yui/ I use it to compress CSS and Javascript.
Within the context of a web application written using the YUI library 3.4.1 it
I've been using YUI Library to develop websites. YUI 3 came out on september.
I'm a big fan of using the YUI library as my CSS and design

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.