diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2019-05-14 15:05:12 +0300 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2019-05-14 15:05:12 +0300 |
commit | fb01d9a438f5c0f89f220e46002a31d870fe6b3b (patch) | |
tree | 096256c99886500add723efdd22219ef7225d4ac /client | |
parent | ddb01bc438efd0c5f4679f5ec2505c69f83a6406 (diff) | |
download | vaadin-framework-fb01d9a438f5c0f89f220e46002a31d870fe6b3b.tar.gz vaadin-framework-fb01d9a438f5c0f89f220e46002a31d870fe6b3b.zip |
Add handling for completely empty Grid's column width calculations. (#11569)
Fixes #11557
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/widgets/Escalator.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index c559c36c18..c60358e449 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -4669,6 +4669,9 @@ public class Escalator extends Widget double maxWidth = Math.max(headerWidth, Math.max(bodyWidth, footerWidth)); + if (maxWidth < 0 && header.getRowCount() == 0 && body.getRowCount() == 0 && footer.getRowCount() == 0) { + maxWidth = 0; + } assert maxWidth >= 0 : "Got a negative max width for a column, which should be impossible."; return maxWidth; } @@ -4681,7 +4684,10 @@ public class Escalator extends Widget double minWidth = Math.max(headerWidth, Math.max(bodyWidth, footerWidth)); - assert minWidth >= 0 : "Got a negative max width for a column, which should be impossible."; + if (minWidth < 0 && header.getRowCount() == 0 && body.getRowCount() == 0 && footer.getRowCount() == 0) { + minWidth = 0; + } + assert minWidth >= 0 : "Got a negative min width for a column, which should be impossible."; return minWidth; } |