Skip to content

Commit 85db1e0

Browse files
authored
Merge pull request #2529 from adumesny/master
fix potential crash in doContentResize()
2 parents e240db8 + d0b6830 commit 85db1e0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

doc/CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change log
55
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

8+
- [9.5.0-dev (TBD)](#950-dev-tbd)
89
- [9.5.0 (2023-10-26)](#950-2023-10-26)
910
- [9.4.0 (2023-10-15)](#940-2023-10-15)
1011
- [9.3.0 (2023-09-30)](#930-2023-09-30)
@@ -103,6 +104,10 @@ Change log
103104

104105
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
105106

107+
## 9.5.0-dev (TBD)
108+
* fix [#2525](https://github.com/gridstack/gridstack.js/commit/2525) Fixed unhandled exception happening in _mouseMove handler
109+
* fix potential crash in doContentResize() if grid gets deleted by the time the delay happens
110+
106111
## 9.5.0 (2023-10-26)
107112
* feat [#1275](https://github.com/gridstack/gridstack.js/issues/1275) div scale support - Thank you [elmehdiamlou](https://github.com/elmehdiamlou) for implementing this teh right way (add scale to current code)
108113
* fix [#2489](https://github.com/gridstack/gridstack.js/commit/2489) moved the dropped event handler to after doing everything (no more setTimeout) - Thanks [arnoudb](https://github.com/arnoudb) for suggesting a fix.

src/gridstack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,7 @@ export class GridStack {
16991699
// update any gridItem height with sizeToContent, but wait for DOM $animation_speed to settle if we changed column count
17001700
// TODO: is there a way to know what the final (post animation) size of the content will be so we can animate the column width and height together rather than sequentially ?
17011701
setTimeout(() => {
1702+
if (!this.engine) return; // we've been deleted in between!
17021703
if (n) {
17031704
if (Utils.shouldSizeToContent(n)) this.resizeToContentCheck(n.el, useAttr);
17041705
} else if (this.engine.nodes.some(n => Utils.shouldSizeToContent(n))) {

0 commit comments

Comments
 (0)