From 226f86debece0f8d860a5aee4e10784a63c16c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Mon, 11 Mar 2019 19:40:33 +0100 Subject: [PATCH] Always have at least one column --- layout-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout-card.js b/layout-card.js index 88fe0dd..10d404f 100644 --- a/layout-card.js +++ b/layout-card.js @@ -80,7 +80,7 @@ class LayoutCard extends cardTools.LitElement { update_columns() { const width = (this.shadowRoot && this.shadowRoot.querySelector("#columns").clientWidth) || (this.parentElement && this.parentElement.clientWidth); - this.colNum = Math.floor(width / this.colWidth); + this.colNum = Math.floor(width / this.colWidth) || 1; this.colNum = Math.max(this.colNum, this.minCols); this.colNum = Math.min(this.colNum, this.maxCols); }