Skip to content

Commit

Permalink
be sure to fire detent event
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok committed Oct 4, 2024
1 parent 6ae75c8 commit 2d13212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/bottom-sheet/ios/SheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
if let contentHeight = self.innerView?.subviews.first?.frame.size.height {
self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight),
preventExpansion: self.preventExpansion)
self.selectedDetentIdentifier = self.sheetVc?.getCurrentDetentIdentifier()
}
}

Expand Down
7 changes: 7 additions & 0 deletions modules/bottom-sheet/ios/SheetViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class SheetViewController: UIViewController {
}
}
}

func getCurrentDetentIdentifier() -> UISheetPresentationController.Detent.Identifier? {
guard let sheet = self.sheetPresentationController else {
return nil
}
return sheet.selectedDetentIdentifier
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
Expand Down

0 comments on commit 2d13212

Please sign in to comment.