Skip to content

Commit f34e418

Browse files
committed
fix(bottomsheet): ios ensure view is loaded before the first viewDidLayoutSubviews call
1 parent bc97d18 commit f34e418

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/bottomsheet/bottomsheet.ios.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,14 @@ class UILayoutViewController extends UIViewController {
209209

210210
viewDidLoad(): void {
211211
super.viewDidLoad();
212-
212+
const owner = this.owner.get();
213+
if (!owner) {
214+
return;
215+
}
216+
if (!owner.parent) {
217+
owner.callLoaded();
218+
console.log('callLoaded done');
219+
}
213220
// Unify translucent and opaque bars layout
214221
this.edgesForExtendedLayout = UIRectEdge.All;
215222
this.extendedLayoutIncludesOpaqueBars = true;
@@ -276,9 +283,10 @@ class UILayoutViewController extends UIViewController {
276283

277284
IOSHelper.updateAutoAdjustScrollInsets(this, owner);
278285

279-
if (!owner.parent) {
280-
owner.callLoaded();
281-
}
286+
// if (!owner.parent) {
287+
// owner.callLoaded();
288+
// console.log('callLoaded done');
289+
// }
282290
}
283291

284292
viewDidDisappear(animated: boolean): void {

0 commit comments

Comments
 (0)