paper-input icon indicating copy to clipboard operation
paper-input copied to clipboard

paper-textarea max-rows doesn't limit the number of rows.

Open phidias51 opened this issue 8 years ago • 0 comments

According to the documentation, the max-rows attribute is "The maximum number of rows this element can grow to until it scrolls. "

When I limit the number of rows to 4, and then paste content into the field, my expectation is that the textarea will not grow beyond 4 rows of text, and that the remainder of the text will overflow the field, and be visible if I scroll down.

In the sample text below, that means that the line starting with the word "surface" should be beyond the scroll pane's viewport and hidden.

CF is caused by a defective or missing CFTR protein resulting from mutations in the CFTR gene. 
Children must inherit two defective CFTR genes — one from each parent — to have CF. There are 
approximately 2,000 known mutations in the CFTR gene. Some of these mutations, which can be 
determined by a genetic test, lead to CF by creating defective or too few CFTR proteins at the cell 
surface. The defective or missing CFTR protein results in poor flow of salt and water into or out of 
the cell in a number of organs, including the lungs. This leads to the buildup of abnormally thick, 
sticky mucus that can cause chronic lung infections and progressive lung damage.

However, what happens is that the field just expands to show all of the text. If the field is in a dialog box (even one using paper-dialog-scrollable), the field expands and shoves the dialog buttons beyond the bottom of the screen. Which is really confusing for users.

If I use css and set the max-height attribute, the text still appears, but it simply over-writes the text below it. Which turns the area below the textarea into a confusing mish-mash of text.

The problem seems to be that the element doesn't really pay attention to text wrapping. If you manually enter returns into the text, then it seems to work properly. But no user's going to do that in order to get the component to work properly.

phidias51 avatar Aug 12 '17 16:08 phidias51