Always have at least one column
This commit is contained in:
parent
5ef29f02f9
commit
226f86debe
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user