-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[iOS] Fixes selection of single line text input #24714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @zhongwuzw in fc8008e. When will my fix make it into a release? | Upcoming Releases |
Hi @zhongwuzw, I'm reverting this because it's causing the following crash:
I believe this is because we're adding a KVO observer to the UITextField but only have a weak reference to it, so it can be deallocated before the observer, causing this crash. Feel free to resubmit the PR with a fix for this crash as well. |
@JoshuaGross Oops, I missing that weak declaration, I'll fix it :). |
Summary: Resubmit #24714. From the #24714 (comment), seems it would crash sometimes. JoshuaGross Hi :) I added a method to let `UITextField` call the cleanup explicitly. Please check again, thanks! ## Changelog [iOS] [Fixed] - Fixes selection of single line text input Pull Request resolved: #24840 Differential Revision: D15415793 Pulled By: JoshuaGross fbshipit-source-id: 2bb32aa8a1fd8fad116177aac760509649c4a423
Hey, @zhongwuzw I was wondering if this change will still be merged since it looks like you made a fix for the crashing problem. The issue from #21515 still exists |
Summary: Resubmit facebook#24714. From the facebook#24714 (comment), seems it would crash sometimes. JoshuaGross Hi :) I added a method to let `UITextField` call the cleanup explicitly. Please check again, thanks! ## Changelog [iOS] [Fixed] - Fixes selection of single line text input Pull Request resolved: facebook#24840 Differential Revision: D15415793 Pulled By: JoshuaGross fbshipit-source-id: 2bb32aa8a1fd8fad116177aac760509649c4a423
Summary
UITextField
don't have delegate to observe the selection changes of users(multiline text inputUITextView
have it), so we can add a KVO to observe selection changes.@cpojer @shergin
Changelog
[iOS] [Fixed] - Fixes selection of single line text input
Test Plan
Create a single line textInput, then do some selection,
onSelectionChange
can be called.