bgrins / ExpandingTextareas

jQuery plugin for elegant expanding textareas
http://bgrins.github.com/ExpandingTextareas/
MIT License
261 stars 73 forks source link

Cannot Wrap Textarea if in Fieldset Tag #48

Open wesleyboar-fka-iosulfur opened 9 years ago

wesleyboar-fka-iosulfur commented 9 years ago

There is a scenario where the affected textarea (and hidden pre tag) will expand to the width of its content, without wrapping.

Prerequisites:

  1. Any parent div of the affected textarea is a fieldset.
  2. Textarea content is one string of alphabetical/numerical characters, that is long enough to wrap.

Result:

Affected textarea (and hidden pre tag) will expand to a width as long as the content.

Problem:

Webkit puts a default style of min-width: -webkit-min-content; on a <fieldset>.

Personal Resolution:

Note:

Excellent plugin. Best I found, and there are many options.

bgrins commented 9 years ago

Sure enough, I see the same thing in Firefox on this page: http://jsfiddle.net/p206gmyo/2/

ZaLiTHkA commented 8 years ago

Looks like there hasn't been any work done on this project for quite a while; has it been abandoned? Either way, just for future reference...

I recently ran into this same issue, but I don't think it's really something that can be "fixed" in this project directly. A nice solution (as explained in this SO answer), is to add the following rules to your application:

fieldset {
  min-width: 0; // for webkit browsers
  display: table-cell; // for gecko browsers
}

Obviously, there are some IE caveats here, but that's also explained in the SO answer linked above.