-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Incorrect form sheet sizing during drag #2428
Comments
Hey @nikita-leonov, thanks for reporting this issue. I believe it is already solved with #2045. You can try these changes out with latest react-native-screens version 4.0.0-beta.13. If this is not the case let us know here, I'll reopen. |
@kkafar what would be the right way to test react-native-screens given the project depends on navigation, native stacks, etc? As of now I just forced resolution through yarn to the latest beta. I could still reproduce this issue with blinking despite using beta 13. I updated the example project with beta 13 too. |
@nikita-leonov you need latest rc of You will most likely experience sheets content being truncated (but not flickering) - you can workaround that with |
AFAIK react navigation team wants to port changes from |
Thanks for clarifying. 🙏 For the functionality I have in hand, content truncated and flickering would be equal severity issues as we have a component at the bottom of a sheet. Is there a ticket to follow regarding the truncation you mentioned above? |
@nikita-leonov we have this issue tracked on our internal board. If you want to do some kind of a footer - it might be hard to achieve in JS for some more time. Short story: flickering you described was caused by the fact that React's layout is asynchronous. When user drags the sheet up, the frame of sheet changes rapidly. We send this information from UI thread to JS (React state), React asynchronously recomputes the layout and mounts freshly computed frames on HostTree (UI thread). However the "freshly computed frames" are at this point already outdated, and too short, because while React was computing the layout the sheet was being continuously dragged up - thus flickering. To get rid of this behaviour we disabled the React's layout of sheet contents when height of a component changes - yeah this is bad, but how do we do this better? Therefore it might be hard to implement any kind of "footer component" for the sheet. However, we do recognise that this is popular pattern thus The silver bullet for the situation might be the possibility of synchronous React Native's layout that should be possible with new architecture, however this has not been researched yet. |
Description
The form sheet while being dragged has a glitchy animation as it does not size itself properly to the bottom of the screen.
Steps to reproduce
Video of the issue:
https://github.com/user-attachments/assets/60052cd9-5448-492b-a2e5-47864a308b54
Snack or a link to a repository
https://github.com/nikita-leonov/react-native-screens-form-sheet-bug
Screens version
3.34.0
React Native version
0.74.5
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 15 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: