mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Don't use the new iPad modal presentation mode for the timeline item menu. (#3325)
This commit is contained in:
parent
c264e9e590
commit
f772849d2e
@ -51,6 +51,7 @@ struct TimelineItemMenu: View {
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.timelineItemActionMenu)
|
||||
.presentationPage()
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationBackground(Color.compound.bgCanvasDefault)
|
||||
.presentationDragIndicator(.visible)
|
||||
@ -233,6 +234,17 @@ private extension EncryptionAuthenticity {
|
||||
}
|
||||
}
|
||||
|
||||
private extension View {
|
||||
/// Uses the old page style modal so that on iPadOS 18 the presentation detents have no effect.
|
||||
@ViewBuilder func presentationPage() -> some View {
|
||||
if #available(iOS 18.0, *) {
|
||||
presentationSizing(.page)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct TimelineItemMenu_Previews: PreviewProvider, TestablePreview {
|
||||
|
Loading…
x
Reference in New Issue
Block a user