Skip to content

Commit 53b9a5a

Browse files
authored
Merge pull request #242 from AndriyGo/master
fix: checks if scroll view calculated its height only on iOS
2 parents ee0a4c6 + c4f0c1b commit 53b9a5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/PopupView/PopupView.swift

+2
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,12 @@ public struct Popup<PopupContent: View>: ViewModifier {
451451
}
452452

453453
.onChange(of: sheetContentRect.size) { sheetContentRect in
454+
#if os(iOS)
454455
// check if scrollView has already calculated its height, otherwise sheetContentRect is already non-zero but yet incorrect
455456
if case .scroll(_) = type, scrollViewRect.height == 0 {
456457
return
457458
}
459+
#endif
458460
positionIsCalculatedCallback()
459461
if shouldShowContent.wrappedValue { // already displayed but the size has changed
460462
actualCurrentOffset = targetCurrentOffset

0 commit comments

Comments
 (0)