mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
Merge pull request #8743 from element-hq/feature/bma/editorIssue
Fix Rich Text Editor issues: save formatted text in draft and keep formatting when switching between modes
This commit is contained in:
commit
22f69ec6b0
2 changed files with 4 additions and 2 deletions
1
changelog.d/7466.bugfix
Normal file
1
changelog.d/7466.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Restore formatting when restoring a draft. Also keep formatting when switching composer mode.
|
|
@ -47,6 +47,7 @@ import com.vanniktech.emoji.EmojiPopup
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.error.fatalError
|
||||
import im.vector.app.core.extensions.orEmpty
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
import im.vector.app.core.extensions.showKeyboard
|
||||
import im.vector.app.core.glide.GlideApp
|
||||
|
@ -255,7 +256,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
|
|||
it.isRecordingVoiceBroadcast && !requireActivity().isChangingConfigurations -> timelineViewModel.handle(VoiceBroadcastAction.Recording.Pause)
|
||||
else -> {
|
||||
timelineViewModel.handle(VoiceBroadcastAction.Listening.Pause)
|
||||
messageComposerViewModel.handle(MessageComposerAction.OnEntersBackground(composer.text.toString()))
|
||||
messageComposerViewModel.handle(MessageComposerAction.OnEntersBackground(composer.formattedText ?: composer.text.orEmpty().toString()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -403,7 +404,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
|
|||
}
|
||||
|
||||
override fun onTextChanged(text: CharSequence) {
|
||||
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(text))
|
||||
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(composer.formattedText ?: text))
|
||||
}
|
||||
|
||||
override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state ->
|
||||
|
|
Loading…
Reference in a new issue