diff options
author | Tatu Lund <tatu@vaadin.com> | 2021-04-19 10:52:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-19 10:52:08 +0300 |
commit | ae15672ae60977376d237b6d5ae41c74d296f1b9 (patch) | |
tree | a724c3882eed91302cfce1363bcc84163cd6dfca /server | |
parent | 222f9bba7d837a1b42190e554d0572f000131732 (diff) | |
download | vaadin-framework-ae15672ae60977376d237b6d5ae41c74d296f1b9.tar.gz vaadin-framework-ae15672ae60977376d237b6d5ae41c74d296f1b9.zip |
Add browser specific handling in setRows (#12141)
* Add browser specific handling in setRows
Fixes: https://github.com/vaadin/framework/issues/10138
Fixes: https://github.com/vaadin/framework/issues/7878
* Enforced minimum height to 1 rows and added a test.
Co-authored-by: Anna Koskinen <anna@vaadin.com>
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/TextArea.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/ui/TextArea.java b/server/src/main/java/com/vaadin/ui/TextArea.java index 7d19948bb3..211cc44a29 100644 --- a/server/src/main/java/com/vaadin/ui/TextArea.java +++ b/server/src/main/java/com/vaadin/ui/TextArea.java @@ -136,13 +136,16 @@ public class TextArea extends AbstractTextField { /** * Sets the number of rows in the text area. + * <p> + * Note: it's not possible to display less than one row via this height + * setting method, so minimum number of rows has been set to 1. * * @param rows * the number of rows for this text area. */ public void setRows(int rows) { - if (rows < 0) { - rows = 0; + if (rows < 1) { + rows = 1; } getState().rows = rows; } |