tthallos / vue-autosize

A simple Vue directive for autosize
http://mage3k.github.io/vue-autosize
MIT License
45 stars 8 forks source link

Does not resize on initial page load #1

Open PhillippOhlandt opened 8 years ago

PhillippOhlandt commented 8 years ago

Hey,

I use it like this:

<textarea name="content" v-model="content" v-autosize="content" class="Article__Edit__Textarea" debounce="500"></textarea>

The content variable is a property on the component. When I load the site, the textarea has its original height until I change something in the text. Is this a bug or intended?

tthallos commented 8 years ago

@PhillippOhlandt Can you give a reproduction link ? because I have no problem with your code.

PhillippOhlandt commented 8 years ago

Hey, sorry for the late reply. Here is a webpackbin: http://www.webpackbin.com/VJpQCmA4b

koronowicz commented 8 years ago

+1

tthallos commented 8 years ago

@PhillippOhlandt The problem may be caused by different versions. The vue version is 1.0.18 in your webpackin. In this version, I find the bind method of the directive has not complie the DOM value, I get the {{msg}} when i get el.value. I have no good idea to fix it, but you can use vue@1.0.11, it works well.

PhillippOhlandt commented 8 years ago

@mage3k Thanks for the explanation. I use vue 1.0.22 in my project and get the same behaviour.

tanigami commented 8 years ago

+1

xiangcatherine commented 7 years ago

+1 Having the same issue

sandrooco commented 6 years ago

@morr's implementation fixes that, simply use his version! https://github.com/morr/vue-autosize/blob/1b2d9fca72110139073416b84ea48ec7473dc8fb/index.js

warent commented 6 years ago

Hi @mage3k I've created a new PR for this fix (Basically just copied @morr's code) with no merge conflicts. Please check in at your earliest convenience