-
Notifications
You must be signed in to change notification settings - Fork 58
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
Schedule to request focus instead of asking immediately #1874
Schedule to request focus instead of asking immediately #1874
Conversation
I confirmed that this fixed the list scrolling to the top and back to the bottom when hitting enter to create a new block (testing steps) when I tested on Android in the example app. I still saw some jumpy looking animations when I opened the block inserter and am not sure if that is already a known issue. Will confirm, and post a video start of day tomorrow if helpful. |
This fix also appears to address the "scroll to the top when hitting enter to create a new paragraph block" issue in my testing. |
My current theory is that the View is not yet in the layout and requesting focus to it causes a scroll to the top of the ScrollView, since the coordinates of the view are not yet updated in respect to its parent. I can be wrong, haven't fully reached the bottom of this issue.
0fa1e5d
to
2647409
Compare
Cameron and Matt have already given a first look at this PR and seems to fix the issue but, added you @marecar3 as a reviewer too to have a look too. Let me know if you can think of some scrolling cases that might be broken by this PR. Thanks! |
Hey @hypest, nice work here! It's working much better now, but it seems that scroll still has some jumpy behavior. Device: Pixel 3 |
Right, I think that the jumping remaining is an older "issue", where the virtual keyboard actually gets hidden momentarily while the focus is first lost from the current block and then refocusing on the new block. The fix in this PR doesn't try to address that part :( If it's not a new issue (would appreciate if you try v1.21.0 to check if it's there too), what do you think about addressing it in a different PR @marecar3? |
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! 👍
Tested on gb-mobile |
👋 @Tug , let me ask, is that behavior happening on an emulator and/or physical device? |
Fixes #1870
My current theory is that the new View is not yet in the proper position in the layout and requesting focus to it causes a scroll to the top of the ScrollView, since the coordinates of the view are not yet updated in respect to its parent. I can be wrong, haven't fully reached the bottom of this issue.
To test A:
To test B:
There's a prior known issue with scrolling to new block added doesn't work so, this PR is not introducing that bug: #1881
PR submission checklist:
RELEASE-NOTES.txt
if necessary.