File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ Change log
93
93
## 8.2.1-dev (TBD)
94
94
* fix [ #2349 ] ( https://github.com/gridstack/gridstack.js/issues/2349 ) grid NoMove vs item NoMove support
95
95
* fix [ #2352 ] ( https://github.com/gridstack/gridstack.js/issues/2352 ) .ui-draggable-dragging z-index for modal dialogs
96
+ * fix [ #2357 ] ( https://github.com/gridstack/gridstack.js/issues/2357 ) NaN inf loop when using cellHeight rem/em
96
97
97
98
## 8.2.1 (2023-05-26)
98
99
* fix: make sure ` removeNode() ` uses internal _ id (unique) and not node itself (since we clone those often)
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < head >
3
+ < title > REM demo</ title >
4
+ < link rel ="stylesheet " href ="../../../demo.css "/>
5
+ < script src ="../../../dist/gridstack-all.js "> </ script >
6
+ </ head >
7
+ < body >
8
+ < div class ="grid-stack "> </ div >
9
+ < script type ="text/javascript ">
10
+ let items = [
11
+ { x : 0 , y : 0 } ,
12
+ { x : 1 , y : 0 } ,
13
+ ] ;
14
+ let count = 0 ;
15
+ items . forEach ( d => d . content = String ( count ++ ) ) ;
16
+
17
+ let grid = GridStack . init ( {
18
+ // cellHeight: '90',
19
+ cellHeight : '8rem' ,
20
+ } ) . load ( items ) ;
21
+ </ script >
22
+ </ body >
23
+ </ html>
Original file line number Diff line number Diff line change @@ -732,7 +732,7 @@ export class GridStack {
732
732
// else get first cell height
733
733
let el = this . el . querySelector ( '.' + this . opts . itemClass ) as HTMLElement ;
734
734
if ( el ) {
735
- let height = Utils . toNumber ( el . getAttribute ( 'gs-h' ) ) ;
735
+ let height = Utils . toNumber ( el . getAttribute ( 'gs-h' ) ) || 1 ; // since we don't write 1 anymore
736
736
return Math . round ( el . offsetHeight / height ) ;
737
737
}
738
738
// else do entire grid and # of rows (but doesn't work if min-height is the actual constrain)
You can’t perform that action at this time.
0 commit comments