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 7790107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:29:21+00:00 2026-06-01T21:29:21+00:00

I have a textarea with the following style applied: textarea { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; }

  • 0

I have a textarea with the following style applied:

textarea {
    -webkit-box-sizing:border-box;
    -moz-box-sizing:border-box;
}

If I then run the following javascript/jquery code, my textarea’s height gets cut in half using Safari(5.0.6) and Chrome(16.0.x):

$('textarea').each( function() {
    var $this = $(this);
    $this.height( $this.height() );
}

According to the jQuery docs for .height(), this is the expected behavior because .height() returns the content height (no padding, border), regardless of the box-sizing property, but .height( value ) sets the content size accounting for the box-sizing property. So if my textarea has content-height:17px and padding-height:15px, .height() will return 17px. Then, if I set .height(17) my textarea that used to be 32px high is now only 17px high.

My real-world application is using jQuery.fn.autoResize 1.14 (https://github.com/padolsey/jQuery.fn.autoResize) on textareas that have box-sizing applied. That code pulls a similar stunt to what I’ve described above.

It works fine in FireFox 10. (That is, FireFox accounts for box-sizing in a more symmetrical way when getting and setting height.)

My question is: Where is the bug, and where should I look for/propose a workaround? The jQuery.fn.autoResize plugin, the jQuery team, webkit, or FireFox?

  • 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-06-01T21:29:23+00:00Added an answer on June 1, 2026 at 9:29 pm

    The bug is in jQuery (http://bugs.jquery.com/ticket/11004) that makes $(el).height() not account for the box-sizing property. The fix is scheduled to go out in v1.8, however in the mean time you can use $(el).outerHeight() to get the height of the box accounting for padding and border (http://api.jquery.com/outerHeight/).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TextArea named TextView . The following is my code: TextView.textFlow =
I have run the following code in this page RsyntaxTextArea using Java and i
I have written a HTML page which has following code. <div id=adsListContainer style=margin: 5px;>
I have a textarea in which the user enters the following data: Paul:Nine, Rome
I have this following setup, a textarea named with some data in it that
I have the following code.... double num1 = Double.parseDouble(textArea_price.getText()); double num2 = Double.parseDouble(textArea_quantity.getText()); double
I have progress.js file which has the following code $('#text_area_input').keyup(function() { var text_area_box =$(this).val();//Get
I have the following html: <div class=bf_form_row> <label for=findout>Text goes here</label> <textarea class=findOut cols=40
I have the following code that basically is a input form as I have
I have the following encoding in the database: &lt;p&gt; Content &lt;span style=&quot;color: #ffffff&quot;&gt;&lt;span style=&quot;background-color:

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.