Provides explanations for check.
This commit is contained in:
parent
1aa1b570b0
commit
bee2ce5e4b
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue