Skip to content

Commit 0c29630

Browse files
committed
fix cellHeight() updating CSS for # of rows
* fix #1579 * make sure to re-create the CSS with actual numer of rows needed when changing cell heights
1 parent dd932b6 commit 0c29630

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Change log
5050
- fix [1572](https://github.com/gridstack/gridstack.js/issues/1572) `column: N` option now sets CSS class
5151
- fix [1571](https://github.com/gridstack/gridstack.js/issues/1571) don't allow drop when grid is full
5252
- fix [1570](https://github.com/gridstack/gridstack.js/issues/1570) easier to drag out/in from below
53+
- fix [1579](https://github.com/gridstack/gridstack.js/issues/1579) `cellHeight()` not updating CSS correctly
5354

5455
## 3.1.4 (2021-1-11)
5556

src/gridstack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ export class GridStack {
582582
this.opts.cellHeight = data.h;
583583

584584
if (update) {
585-
this._updateStyles(true); // true = force re-create
585+
this._updateStyles(true, this.getRow()); // true = force re-create, for that # of rows
586586
}
587587
this._resizeNestedGrids(this.el);
588588
return this;

src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ export class Utils {
147147
/** removed the given stylesheet id */
148148
static removeStylesheet(id: string): void {
149149
let el = document.querySelector('STYLE[gs-style-id=' + id + ']');
150-
if (!el || !el.parentNode) return;
151-
el.parentNode.removeChild(el);
150+
if (el && el.parentNode) el.remove();
152151
}
153152

154153
/** inserts a CSS rule */

0 commit comments

Comments
 (0)