Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paper-textarea does not respect max-rows #158

Closed
anthonytordillos opened this issue Aug 24, 2015 · 7 comments
Closed

paper-textarea does not respect max-rows #158

anthonytordillos opened this issue Aug 24, 2015 · 7 comments
Assignees

Comments

@anthonytordillos
Copy link

Looks like the demo of this functionality in the elements catalog is broken: https://elements.polymer-project.org/elements/paper-input?view=demo:demo/index.html

@notwaldorf
Copy link
Contributor

What browser are you seeing this on? When I use the textarea that has max-rows="4" set, then it starts scrolling once they're hit:

teaxtarea

@notwaldorf notwaldorf self-assigned this Aug 25, 2015
@anthonytordillos
Copy link
Author

It looks like the behavior is correct when you have newlines in the text. The case I'm describing is when you have long text that wraps to multiple lines:

textarea

Based on the description of the maxRows property (The maximum number of rows this element can grow to until it scrolls.) I would expect it to scroll once the text has wrapped past maxRows lines.

@notwaldorf
Copy link
Contributor

Ah, yes, I think that's related to PolymerElements/iron-autogrow-textarea#32

@anthonytordillos
Copy link
Author

Yup. I agree with nloewen's conclusion that constrain should line wraps into account.

@theDataWhore
Copy link

so max-rows counts the new lines instead of the 'visible' row counts? i also noticed in the docs its maxRows not max-rows, but max-rows works.. i'm new to git so if i'm retreading something my apologies.

@notwaldorf
Copy link
Contributor

You should use maxRows as a JavaScript property , and max-rows as an attribute in HTML: https://www.polymer-project.org/1.0/docs/devguide/properties.html#property-name-mapping

Closing this, since it seems to be an underlying iron-autogrow-textarea bug,

@faan11
Copy link

faan11 commented Dec 12, 2016

A solution would be to block the height of the iron-autogrow-textarea. It works but you have to compute the size in pixel.

:host{
      --paper-input-container-input:{
        max-height: 75px;
      }
 }

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

No branches or pull requests

4 participants