-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Update KeyboardAwareFlatList iOS implementation #33170
[RNMobile] Update KeyboardAwareFlatList iOS implementation #33170
Conversation
Use KeyboardAwareFlatList component instead of KeyboardAwareScrollView to prevent triggering the error: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.
Size Change: 0 B Total Size: 1.08 MB ℹ️ View Unchanged
|
The work is completed, the only thing it was pending was testing thoroughly the changes as it affects the block list, besides I wanted to double-check that it doesn't introduce undesired side effects. I think it would be great if you include it in the RN upgrade, as we could do the testing there, wdyt? |
@fluiddot given we will likely need to test the RN upgrade thoroughly, it does seem like a good place to include this work. I will update the target branch for this PR and review. |
Awesome, I'll set it ready for review 🎊 . |
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 for putting this together. 🙇🏻 It will be great to silence this error and potentially improve the performance of the app. I noticed a couple of issues. I hope to make time to explore them a bit more. I will report back any findings.
From testing, I am seeing some odd jumping when at the bottom of the block list. When at the bottom, if I scroll downwards and release, there is small jump that occurs. If scroll slowly upwards, the scroll position appears to jump upwards.
end-of-scroll-jumping.MP4
Additionally, when scrolling very quickly, you can see various UI layout updates occur. This isn't incredibly surprising, given this is a FlatList
, but it is not the smoothest. We may have an opportunity to reduce re-renders or it could be some of the props overrides with ...listProps
cause issue.
Frame 1 | Frame 2 | Frame 3 |
---|---|---|
delayed-ui-layout.MP4
packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js
Outdated
Show resolved
Hide resolved
latestContentOffsetY.current = | ||
event.nativeEvent.contentOffset.y; | ||
} } | ||
{ ...listProps } |
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.
I wonder if this relocated prop spread is unintentionally overriding some of the props set above, or some of the locally set props are irrelevant. There appears to be only one usage of this component and it sets several style properties itself. We may need to merge the props or remove the locally set props.
keyboardShouldPersistTaps
style
scrollViewStyle
contentContainerStyle
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.
Yep, good point, we should review what was the purpose of the different style ones (style
, scrollViewStyle
and contentContainerStyle
) in the original component and decide in each case the best way to proceed, probably some of the local ones are no longer necessary.
…ios.js Co-authored-by: David Calhoun <[email protected]>
Description
Use
KeyboardAwareFlatList
component instead ofKeyboardAwareScrollView
to prevent triggering the error:Fixes: #32884
How has this been tested?
Verify that the block list works as expected
The component
KeyboardAwareFlatList
is used for rendering the blocks so this has been tested by interacting with the block list:Verify that the block list is aware of the keyboard
Screenshots
N/A
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).