From ae15672ae60977376d237b6d5ae41c74d296f1b9 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 19 Apr 2021 10:52:08 +0300 Subject: 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 --- server/src/main/java/com/vaadin/ui/TextArea.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/src') 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. + *

+ * 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; } -- cgit v1.2.3