diff --git a/ElementX/Sources/Screens/ComposerToolbar/View/ComposerToolbar.swift b/ElementX/Sources/Screens/ComposerToolbar/View/ComposerToolbar.swift index 5472b039b..24eba0bb7 100644 --- a/ElementX/Sources/Screens/ComposerToolbar/View/ComposerToolbar.swift +++ b/ElementX/Sources/Screens/ComposerToolbar/View/ComposerToolbar.swift @@ -29,6 +29,7 @@ struct ComposerToolbar: View { @FocusState private var composerFocused: Bool @State private var frame: CGRect = .zero @Environment(\.verticalSizeClass) private var verticalSizeClass + @State private var hasAlreadyAppeared = false var body: some View { VStack(spacing: 8) { @@ -174,7 +175,11 @@ struct ComposerToolbar: View { } editCancellationAction: { context.send(viewAction: .cancelEdit) } onAppearAction: { + guard !hasAlreadyAppeared else { + return + } context.send(viewAction: .composerAppeared) + hasAlreadyAppeared = true } .focused($composerFocused) .onChange(of: context.composerFocused) { newValue in diff --git a/changelog.d/2275.bugfix b/changelog.d/2275.bugfix new file mode 100644 index 000000000..a9aae09d8 --- /dev/null +++ b/changelog.d/2275.bugfix @@ -0,0 +1 @@ +Composer won't reset its content the app is backgrounded on iPad. \ No newline at end of file