Skip to content

Commit

Permalink
Reset composer text when there is provisional text (e.g. Japanese - k…
Browse files Browse the repository at this point in the history
…ana keyboard) but the text is reset to empty string
  • Loading branch information
laevandus committed Jun 18, 2024
1 parent c00c74d commit 80e6367
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed
### 🐞 Fixed
- Reset composer text when there is provisional text (e.g. Japanese - kana keyboard) but the text is reset to empty string [#512](https://github.com/GetStream/stream-chat-swiftui/pull/512)

# [4.57.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.57.0)
_June 07, 2024_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ struct ComposerTextInputView: UIViewRepresentable {

func updateUIView(_ uiView: InputTextView, context: Context) {
DispatchQueue.main.async {
if uiView.markedTextRange == nil {
// Clear marked text if text is reset
let canUpdate = uiView.markedTextRange == nil || text.isEmpty
if canUpdate {
var shouldAnimate = false
if uiView.text != text {
let previousLocation = selectedRangeLocation
Expand Down
30 changes: 15 additions & 15 deletions StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1704,29 +1704,29 @@
8465FD0F2746A95600AF091E /* Composer */ = {
isa = PBXGroup;
children = (
84EADEB32B2893420046B50C /* VoiceRecording */,
84AB7B222773526D00631A10 /* Suggestions */,
8465FD1B2746A95600AF091E /* MessageComposerView.swift */,
8465FD102746A95600AF091E /* MessageComposerViewModel.swift */,
84EADEC02B2AFA690046B50C /* MessageComposerViewModel+Recording.swift */,
84EADEB12B2883C60046B50C /* TrailingComposerView.swift */,
84EADEB32B2893420046B50C /* VoiceRecording */,
8465FD1E2746A95600AF091E /* AddedFileAttachmentsView.swift */,
8465FD172746A95600AF091E /* AddedImageAttachmentsView.swift */,
8465FD112746A95600AF091E /* AttachmentPickerTypeView.swift */,
8465FD1C2746A95600AF091E /* AttachmentPickerView.swift */,
8465FD192746A95600AF091E /* AttachmentUploadingStateView.swift */,
844CC60D2811378D0006548D /* ComposerConfig.swift */,
8465FD1A2746A95600AF091E /* ComposerHelperViews.swift */,
841B64C327744DB60016FF3B /* ComposerModels.swift */,
8465FD132746A95600AF091E /* ComposerTextInputView.swift */,
8492975127B156D000A8EEB0 /* SlowModeView.swift */,
8465FD1D2746A95600AF091E /* PhotoAttachmentPickerView.swift */,
8465FD172746A95600AF091E /* AddedImageAttachmentsView.swift */,
8465FD1E2746A95600AF091E /* AddedFileAttachmentsView.swift */,
8465FD122746A95600AF091E /* SendMessageButton.swift */,
8465FD142746A95600AF091E /* DiscardAttachmentButton.swift */,
8465FD152746A95600AF091E /* FilePickerView.swift */,
8465FD162746A95600AF091E /* ImagePickerView.swift */,
84DEC8EB27611CAE00172876 /* SendInChannelView.swift */,
8465FD192746A95600AF091E /* AttachmentUploadingStateView.swift */,
8465FD1A2746A95600AF091E /* ComposerHelperViews.swift */,
841B64C327744DB60016FF3B /* ComposerModels.swift */,
8465FD1B2746A95600AF091E /* MessageComposerView.swift */,
8465FD102746A95600AF091E /* MessageComposerViewModel.swift */,
84EADEC02B2AFA690046B50C /* MessageComposerViewModel+Recording.swift */,
8465FD182746A95600AF091E /* PhotoAssetsUtils.swift */,
844CC60D2811378D0006548D /* ComposerConfig.swift */,
8465FD1D2746A95600AF091E /* PhotoAttachmentPickerView.swift */,
84DEC8EB27611CAE00172876 /* SendInChannelView.swift */,
8465FD122746A95600AF091E /* SendMessageButton.swift */,
8492975127B156D000A8EEB0 /* SlowModeView.swift */,
84EADEB12B2883C60046B50C /* TrailingComposerView.swift */,
);
path = Composer;
sourceTree = "<group>";
Expand Down

0 comments on commit 80e6367

Please sign in to comment.