diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 6824d7846..aa6a6dc71 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -40,6 +40,7 @@ Change log - add `getGridItems()` to return list of HTML grid items - add `{dragIn | dragInOptions}` grid attributes to handle external drag&drop items - add `save()` and `restore()` to serialize grids from JSON, saving all attributes (not just w,h,x,y) [1286](https://github.com/gridstack/gridstack.js/issues/1286) +- fix [1299](https://github.com/gridstack/gridstack.js/pull/1299) many columns round-off error ## 1.1.2 (2020-05-17) diff --git a/spec/e2e/html/810-many-columns.html b/spec/e2e/html/810-many-columns.html index 6274248dc..3bfbc210d 100644 --- a/spec/e2e/html/810-many-columns.html +++ b/spec/e2e/html/810-many-columns.html @@ -8,11 +8,7 @@ - - - - - +
@@ -30,8 +26,7 @@

Many Columns demo

let count = 0; let options = { column: COLUMNS, - cellHeight: 'auto', - float: false + cellHeight: 'auto' }; let grid = GridStack.init(options); diff --git a/src/gridstack.ts b/src/gridstack.ts index df533475d..474f573ed 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -424,7 +424,7 @@ export class GridStack { */ public cellWidth(): number { // TODO: take margin into account (horizontal_padding in .scss) to make cellHeight='auto' square ? (see 810-many-columns.html) - return Math.round(this.el.offsetWidth / this.opts.column); + return this.el.offsetWidth / this.opts.column; } /**