From d2a735809d711d75a38174917ca9b51f3d0bafe6 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 21 Feb 2018 15:56:40 +0530 Subject: [PATCH] Handle falsy column width --- dist/frappe-datatable.cjs.js | 2 +- dist/frappe-datatable.js | 2 +- src/style.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/frappe-datatable.cjs.js b/dist/frappe-datatable.cjs.js index 11a346f..e89047f 100644 --- a/dist/frappe-datatable.cjs.js +++ b/dist/frappe-datatable.cjs.js @@ -2168,7 +2168,7 @@ class Style { setupColumnWidth() { this.datamanager.getColumns() .map(column => { - if (column.width === null) { + if (!column.width) { column.width = column.naturalWidth; } if (column.width < column.minWidth) { diff --git a/dist/frappe-datatable.js b/dist/frappe-datatable.js index 5edabbb..672256d 100644 --- a/dist/frappe-datatable.js +++ b/dist/frappe-datatable.js @@ -2167,7 +2167,7 @@ class Style { setupColumnWidth() { this.datamanager.getColumns() .map(column => { - if (column.width === null) { + if (!column.width) { column.width = column.naturalWidth; } if (column.width < column.minWidth) { diff --git a/src/style.js b/src/style.js index d4c7ab3..f0afea9 100644 --- a/src/style.js +++ b/src/style.js @@ -131,7 +131,7 @@ export default class Style { setupColumnWidth() { this.datamanager.getColumns() .map(column => { - if (column.width === null) { + if (!column.width) { column.width = column.naturalWidth; } if (column.width < column.minWidth) {