Provides explanations for check.

This commit is contained in:
Krunoslav Zaher 2016-05-13 00:47:44 +02:00
parent 1aa1b570b0
commit bee2ce5e4b
2 changed files with 6 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}