Skip to content

Commit 71d3580

Browse files
committed
fix(dialogs): ios fix for custom view with message set
1 parent 1b6dd47 commit 71d3580

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/dialogs/dialogs.ios.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ class UIViewAutoSizeUIViewAutoSize extends UIView {
3333
if (!view) {
3434
return CGSizeZero;
3535
}
36+
// if message is set on the dialog
37+
// this is called with an infinite boundsSize.width which would
38+
// make the view size itself to as big as possible
39+
// which we never want
40+
// instead we try and return our previously measured size
41+
if (boundsSize.width >= Number.MAX_SAFE_INTEGER) {
42+
return this.bounds.size;
43+
}
3644
const actualWidth = Math.min(boundsSize.width, Screen.mainScreen.widthPixels);
3745
const widthSpec = Utils.layout.makeMeasureSpec(Utils.layout.toDevicePixels(actualWidth), Utils.layout.EXACTLY);
3846
const heighthSpec = Utils.layout.makeMeasureSpec(Utils.layout.toDevicePixels(boundsSize.height), Utils.layout.UNSPECIFIED);

0 commit comments

Comments
 (0)