diff --git a/Mastodon/Scene/Compose/TableViewCell/ComposeStatusContentTableViewCell.swift b/Mastodon/Scene/Compose/TableViewCell/ComposeStatusContentTableViewCell.swift index c9c8fa4f..4c3d3716 100644 --- a/Mastodon/Scene/Compose/TableViewCell/ComposeStatusContentTableViewCell.swift +++ b/Mastodon/Scene/Compose/TableViewCell/ComposeStatusContentTableViewCell.swift @@ -161,7 +161,10 @@ extension ComposeStatusContentTableViewCell: UITextViewDelegate { logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): text: \(textView.text ?? "")") guard textView === statusContentWarningEditorView.textView else { return } // replace line break with space - textView.text = textView.text.replacingOccurrences(of: "\n", with: " ") + // needs check input state to prevent break the IME + if textView.markedTextRange == nil { + textView.text = textView.text.replacingOccurrences(of: "\n", with: " ") + } contentWarningContent.send(textView.text) } diff --git a/ShareActionExtension/Scene/View/StatusEditorView.swift b/ShareActionExtension/Scene/View/StatusEditorView.swift index c945874e..595057fa 100644 --- a/ShareActionExtension/Scene/View/StatusEditorView.swift +++ b/ShareActionExtension/Scene/View/StatusEditorView.swift @@ -81,7 +81,10 @@ public struct StatusEditorView: UIViewRepresentable { } public func textViewDidChange(_ textView: UITextView) { - parent.string = textView.text + // prevent break IME input + if textView.markedTextRange == nil { + parent.string = textView.text + } } func updateLayout(width: CGFloat) {