diff --git a/RxCocoa/iOS/UITextField+Rx.swift b/RxCocoa/iOS/UITextField+Rx.swift index d1e2bfc0..c45957dc 100644 --- a/RxCocoa/iOS/UITextField+Rx.swift +++ b/RxCocoa/iOS/UITextField+Rx.swift @@ -25,6 +25,9 @@ extension UITextField : RxTextInput { getter: { textField in textField.text ?? "" }, setter: { textField, value in + // This check is important because setting text value always clears control state + // including marked text selection which is imporant for proper input + // when IME input method is used. if textField.text != value { textField.text = value } diff --git a/RxCocoa/iOS/UITextView+Rx.swift b/RxCocoa/iOS/UITextView+Rx.swift index 2d11afc1..e9828837 100644 --- a/RxCocoa/iOS/UITextView+Rx.swift +++ b/RxCocoa/iOS/UITextView+Rx.swift @@ -53,6 +53,9 @@ extension UITextView : RxTextInput { } let bindingObserver = UIBindingObserver(UIElement: self) { (textView, text: String) in + // This check is important because setting text value always clears control state + // including marked text selection which is imporant for proper input + // when IME input method is used. if textView.text != text { textView.text = text }