-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UITextView.rx_text doesn't catch iOS autocorrect text changes #333
Comments
Hi @timojaask , I've confirmed the problem. This is the only way I know how to solve this, but I don't like it. Any ideas how to solve this more elegantly? |
Hi, guys |
Hi @sergdort , that's an interesting idea :) I've just tried it, and unfortunately it doesn't seem to work either :/ Also Is there some obvious API I'm missing? |
Just looked at how ReactiveCocoa did this, looks like they did the same and probable they also have bug =) |
Haha, yeah, I've also checked other reactive/binding frameworks :) This hack is the best thing I could conjure so far. ¯_(ツ)_/¯ |
How about observe Looks like this bug appears only when you moving focus away from the text view |
Yeah, that also appears to be working ... I'm wondering is there any other edge case like this one what Maybe we can use |
Looks like this bug could also appears on |
There is also
could work too |
I have noticed that same behavior on UITextField also. I've also been able to repro this without ending editing :( I think it's worth a shot to try
... for I'm still unsure how to solve |
Hi @kzaher With this setup I was able to get all changes of text |
Fixes regarding UITextField rx_text autocorrection bug #333
Hi @kzaher looks like NSTextStorageDelegate works great, please take a look, may be I did something wrong :) |
Fixes for UITextView rx_text bug with autocorrect enabled #333
This is done :) |
UITextView.rx_text
observes text changes viatextViewDidChange
. Unfortunately, when text changes due to iOS autocorrect, thetextViewDidChange
is not called, thereforerx_text
never receives that new text.You can test it by creating a text view, make sure autocorrection is enabled, observe
rx_text
, type a misspelled word and move focus away from the text view. The text will be automatically corrected, but the last change will never be observed viarx_text
, becausetextViewDidChange
doesn't fire when autocorrect happens.The text was updated successfully, but these errors were encountered: