Skip to content

Commit 6e2ceff

Browse files
committed
fix(tldraw-v2): crash in mobile views
When in mobile, the size width is reported as 0, causing a crash in tldraw because of invalid zoom. Abort zoom calculation in those cases.
1 parent c857372 commit 6e2ceff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/tldraw_v2/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ const TldrawPresentationV2 = ({ size }) => {
121121
}
122122

123123
React.useEffect(() => {
124+
if (size.width <= 0 || size.height <= 0) {
125+
return;
126+
}
124127
let zoom =
125128
Math.min(
126129
svgWidth / viewboxWidth,

0 commit comments

Comments
 (0)