mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-01 18:07:22 +01:00
fix: textView break IME input issue. resolve #342
This commit is contained in:
parent
ad524b0172
commit
4614bd8692
@ -161,7 +161,10 @@ extension ComposeStatusContentTableViewCell: UITextViewDelegate {
|
||||
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): text: \(textView.text ?? "<nil>")")
|
||||
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)
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user