Skip to content

Commit 473ec8d

Browse files
authored
Reset composer text when there is provisional text (e.g. Japanese - kana keyboard) but the text is reset to empty string (#512)
1 parent 45b01bc commit 473ec8d

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### 🐞 Fixed
1010
- Dismiss keyboard when tapping on the empty message list [#513](https://github.com/GetStream/stream-chat-swiftui/pull/513)
11+
- 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)
1112

1213
# [4.57.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.57.0)
1314
_June 07, 2024_

Sources/StreamChatSwiftUI/ChatChannel/Composer/ComposerTextInputView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ struct ComposerTextInputView: UIViewRepresentable {
4343

4444
func updateUIView(_ uiView: InputTextView, context: Context) {
4545
DispatchQueue.main.async {
46-
if uiView.markedTextRange == nil {
46+
// Clear marked text if text is reset
47+
let canUpdate = uiView.markedTextRange == nil || text.isEmpty
48+
if canUpdate {
4749
var shouldAnimate = false
4850
if uiView.text != text {
4951
let previousLocation = selectedRangeLocation

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,29 +1704,29 @@
17041704
8465FD0F2746A95600AF091E /* Composer */ = {
17051705
isa = PBXGroup;
17061706
children = (
1707-
84EADEB32B2893420046B50C /* VoiceRecording */,
17081707
84AB7B222773526D00631A10 /* Suggestions */,
1709-
8465FD1B2746A95600AF091E /* MessageComposerView.swift */,
1710-
8465FD102746A95600AF091E /* MessageComposerViewModel.swift */,
1711-
84EADEC02B2AFA690046B50C /* MessageComposerViewModel+Recording.swift */,
1712-
84EADEB12B2883C60046B50C /* TrailingComposerView.swift */,
1708+
84EADEB32B2893420046B50C /* VoiceRecording */,
1709+
8465FD1E2746A95600AF091E /* AddedFileAttachmentsView.swift */,
1710+
8465FD172746A95600AF091E /* AddedImageAttachmentsView.swift */,
17131711
8465FD112746A95600AF091E /* AttachmentPickerTypeView.swift */,
17141712
8465FD1C2746A95600AF091E /* AttachmentPickerView.swift */,
1713+
8465FD192746A95600AF091E /* AttachmentUploadingStateView.swift */,
1714+
844CC60D2811378D0006548D /* ComposerConfig.swift */,
1715+
8465FD1A2746A95600AF091E /* ComposerHelperViews.swift */,
1716+
841B64C327744DB60016FF3B /* ComposerModels.swift */,
17151717
8465FD132746A95600AF091E /* ComposerTextInputView.swift */,
1716-
8492975127B156D000A8EEB0 /* SlowModeView.swift */,
1717-
8465FD1D2746A95600AF091E /* PhotoAttachmentPickerView.swift */,
1718-
8465FD172746A95600AF091E /* AddedImageAttachmentsView.swift */,
1719-
8465FD1E2746A95600AF091E /* AddedFileAttachmentsView.swift */,
1720-
8465FD122746A95600AF091E /* SendMessageButton.swift */,
17211718
8465FD142746A95600AF091E /* DiscardAttachmentButton.swift */,
17221719
8465FD152746A95600AF091E /* FilePickerView.swift */,
17231720
8465FD162746A95600AF091E /* ImagePickerView.swift */,
1724-
84DEC8EB27611CAE00172876 /* SendInChannelView.swift */,
1725-
8465FD192746A95600AF091E /* AttachmentUploadingStateView.swift */,
1726-
8465FD1A2746A95600AF091E /* ComposerHelperViews.swift */,
1727-
841B64C327744DB60016FF3B /* ComposerModels.swift */,
1721+
8465FD1B2746A95600AF091E /* MessageComposerView.swift */,
1722+
8465FD102746A95600AF091E /* MessageComposerViewModel.swift */,
1723+
84EADEC02B2AFA690046B50C /* MessageComposerViewModel+Recording.swift */,
17281724
8465FD182746A95600AF091E /* PhotoAssetsUtils.swift */,
1729-
844CC60D2811378D0006548D /* ComposerConfig.swift */,
1725+
8465FD1D2746A95600AF091E /* PhotoAttachmentPickerView.swift */,
1726+
84DEC8EB27611CAE00172876 /* SendInChannelView.swift */,
1727+
8465FD122746A95600AF091E /* SendMessageButton.swift */,
1728+
8492975127B156D000A8EEB0 /* SlowModeView.swift */,
1729+
84EADEB12B2883C60046B50C /* TrailingComposerView.swift */,
17301730
);
17311731
path = Composer;
17321732
sourceTree = "<group>";

0 commit comments

Comments
 (0)