Skip to content

Commit ca38ad6

Browse files
committed
Fix action sheet not showing when discarding Poll creation on iOS 26
1 parent 8903e77 commit ca38ad6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ public struct CreatePollView: View {
175175
} label: {
176176
Text(L10n.Alert.Actions.cancel)
177177
}
178+
.actionSheet(isPresented: $viewModel.discardConfirmationShown) {
179+
ActionSheet(
180+
title: Text(L10n.Composer.Polls.actionSheetDiscardTitle),
181+
buttons: [
182+
.destructive(Text(L10n.Alert.Actions.discardChanges)) {
183+
presentationMode.wrappedValue.dismiss()
184+
},
185+
.default(Text(L10n.Alert.Actions.keepEditing))
186+
]
187+
)
188+
}
178189
}
179190

180191
ToolbarItem(placement: .principal) {
@@ -195,17 +206,6 @@ public struct CreatePollView: View {
195206
}
196207
}
197208
.navigationBarTitleDisplayMode(.inline)
198-
.actionSheet(isPresented: $viewModel.discardConfirmationShown) {
199-
ActionSheet(
200-
title: Text(L10n.Composer.Polls.actionSheetDiscardTitle),
201-
buttons: [
202-
.destructive(Text(L10n.Alert.Actions.discardChanges)) {
203-
presentationMode.wrappedValue.dismiss()
204-
},
205-
.cancel(Text(L10n.Alert.Actions.keepEditing))
206-
]
207-
)
208-
}
209209
.alert(isPresented: $viewModel.errorShown) {
210210
Alert.defaultErrorAlert
211211
}

0 commit comments

Comments
 (0)