Skip to content

Commit 6692671

Browse files
author
Nicolas ERNY
authored
Bug(#116): case with the div size is zero (#117)
1 parent a7ff198 commit 6692671

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-gojs",
3-
"version": "4.6.2",
3+
"version": "4.7.0",
44
"description": "GoJS React integration",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/GojsDiagram.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ class GojsDiagram<N extends BaseNodeModel, L extends LinkModel> extends React.Pu
7070
this.mountInterval = setInterval(() => {
7171
if (this.divRef.current) {
7272
let nextValue = JSON.stringify(this.divRef.current.getBoundingClientRect());
73-
if (nextValue === prevValue) {
73+
if (
74+
nextValue === prevValue &&
75+
this.divRef.current.getBoundingClientRect().height &&
76+
this.divRef.current.getBoundingClientRect().width
77+
) {
7478
clearInterval(this.mountInterval);
7579
this.init();
7680
} else {

0 commit comments

Comments
 (0)