-
Notifications
You must be signed in to change notification settings - Fork 48
Wrapped lines expand textarea with available space #32
Comments
@nloewen I think this is related to PolymerElements/paper-input#125, and it's happening because the textarea's nor its parent have a fixed/max size. Does that explanation make sense? |
Fixing the text area's height takes the autogrow out of iron-autogrow-textarea and overrides the rows property. The issue seems to be that _constrain() doesn't consider a line wrap as a new line. If a line wraps onto a second, it should count towards the total line count for the purposes of sizing the text area |
I agree line wraps should count when limiting text area's size; does anyone have an idea of how to fix that? Or will it be fixed on next versions? |
A way to fix it is to use a canvas measure or a aria pixel plot measure which calculates pixel distance to line end and then clicks the row max counter at that distance. We implemented the same for a line numbering, paragraph reading, and syllabic word breaker, which calculated word length and distance to end line to determine both when a word should wrap abs when wrap was insufficient and a word break was needed. Here, zero is zero so less than one pixel would do the trick. |
1 similar comment
A way to fix it is to use a canvas measure or a aria pixel plot measure which calculates pixel distance to line end and then clicks the row max counter at that distance. We implemented the same for a line numbering, paragraph reading, and syllabic word breaker, which calculated word length and distance to end line to determine both when a word should wrap abs when wrap was insufficient and a word break was needed. Here, zero is zero so less than one pixel would do the trick. |
Any update on this bug? |
Any news? |
Which version is it slotted in? |
Is this an issue related to a swap in policies regarding white space clipping in browsers to facilitate both template strings and Dom parsing My understanding is that the newer, followed spec will leave the space, and then a CSS approach or a /^\s*(?!:\b) /g should do all save a space in all new lines There are other reg ex approaches I know there is something in CSS and that polymer specifically has a strip white space "call" that is simple to use. It's I the docs. Will look for you when I get home off you need it Sent from my iPhone
|
On an iron-autogrow-textarea with empty lines, a single long line will not take up one of these, and will instead expand the text area.
Steps to reproduce:
<iron-autogrow-textarea rows="4></iron-autogrow-textarea>
The text was updated successfully, but these errors were encountered: