Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

paper-autogrow-textarea has problems calculating height on multiple lines #162

Closed
gertcuykens opened this issue Mar 7, 2015 · 4 comments

Comments

@gertcuykens
Copy link

example

http://embed.plnkr.co/js3uFQSRsIR7SuGLt2gP/preview

this does not work

t1.value = 'some\ntext';
a1.update();

@gertcuykens gertcuykens changed the title paper-autogrow-textarea has problems calculating initial height of text input on page load paper-autogrow-textarea has problems calculating height on multiple lines Mar 10, 2015
@gertcuykens
Copy link
Author

Need expert advice please :) I need this thing working

@gghez
Copy link

gghez commented Mar 11, 2015

Did you try:

this.$.a1.update(this.$.t1);

When reading autogrow source code, when update() argument is not provided it try evaluate an empty token array.

Also documentation is not up-to-date, some properties are unused in code like target and update() documentation is wrong because in fact you can pass an argument to it which is the targeted HTMLTextAreaElement.

Truth is in the code.

@notwaldorf
Copy link
Contributor

Yeah, @gghez is right; you need to pass the textarea element as a parameter. I've created a PR to update the docs.

@gertcuykens
Copy link
Author

Ok that worked thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants