From e0ec2f21ad0a0b04c74292707f8a1f3e6c813b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 20 Feb 2019 18:11:44 +0100 Subject: [PATCH] Fix for vertical-stack-in-card --- layout-card.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layout-card.js b/layout-card.js index 232abcd..f5b0bd9 100644 --- a/layout-card.js +++ b/layout-card.js @@ -63,9 +63,9 @@ class LayoutCard extends Polymer.Element { if (this.config.column_num) { numcols = this.config.column_num; } else { - let colWidth = this.config.column_width || 300; - numcols = Math.max(1, - this.parentElement ? Math.floor(this.parentElement.clientWidth/this.config.column_width) : 0); + const cardWidth = this.$.columns.clientWidth || (this.parentElement && this.parentElement.clientWidth); + + numcols = Math.max(1, Math.floor(cardWidth/this.config.column_width)); } numcols = Math.min(numcols, this.config.max_columns); if(numcols != this.colnum) {