From 2d9a304638dbf3d2014b340752590ee7e153755c Mon Sep 17 00:00:00 2001 From: AndroidBob Date: Fri, 24 Nov 2023 11:54:07 +0100 Subject: [PATCH] fix: closing keyboard or back pressing when editing a message (#2467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: MichaƂ Saleniuk --- .../android/ui/home/messagecomposer/EnabledMessageComposer.kt | 3 +++ .../android/ui/home/messagecomposer/MessageComposerInput.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt index 900e5a2f26b..e2de04840ec 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt @@ -282,6 +282,9 @@ fun EnabledMessageComposer( } } + BackHandler(inputStateHolder.inputType is MessageCompositionType.Editing) { + cancelEdit() + } BackHandler(isImeVisible || inputStateHolder.optionsVisible) { inputStateHolder.handleBackPressed( isImeVisible, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt index 7981a6849ff..5cd0d3f7b1d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt @@ -200,7 +200,7 @@ private fun InputContent( onPlusClick: () -> Unit, modifier: Modifier, ) { - if (!showOptions) { + if (!showOptions && inputType is MessageCompositionType.Composing) { AdditionalOptionButton( isSelected = false, onClick = {