Skip to content
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

Fix: multiline textinput start "jerking" when trying to move cursor. #32179

Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Libraries/Text/TextInput/Multiline/RCTUITextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,17 @@ - (void)paste:(id)sender
_textWasPasted = YES;
}

// Excluding this for iOS 14 and above.
// This fixes multiline textinput "jerking" when trying to move cursor.
// See https://github.com/facebook/react-native/issues/30748 for more context.
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED < 140000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the back and forth but chatting internally, we'll update this comment to the following since it seems like setContentOffset animated:NO was originally a fix for "flaky scrolling" for versions prior to iOS 14

// Turn off scroll animation to fix flaky scrolling.
// This is only necessary for iOS <= 13

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries at all, this makes more sense and actually reduces the chance of confusion for the next maintainer, thanks for that.

- (void)setContentOffset:(CGPoint)contentOffset animated:(__unused BOOL)animated
{
// Turning off scroll animation.
// This fixes the problem also known as "flaky scrolling".
[super setContentOffset:contentOffset animated:NO];
}
#endif

- (void)selectAll:(id)sender
{
Expand Down