-
Notifications
You must be signed in to change notification settings - Fork 59
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 scrolling lines into view #514
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.
lgtm!
// In case the caret is below the visible input area, scroll to the end of the node | ||
if (caretRect.top + caretRect.height > targetRect.top + targetRect.height) { | ||
targetElement.scrollTop = caretRect.top - targetRect.top + target.scrollTop - targetRect.height + caretRect.height + 4; | ||
return; |
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.
Do we need this return?
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.
Yes, we only want to change scrollTop. Executing the rest of the code below can cause scroll jumps
Details
THis PR fixies the problem with scrolling elements into view.It changes the logic to now scroll the whole line into view instead of just a child element
Related Issues
Expensify/App#50174
Manual Tests
Linked PRs