-
-
Notifications
You must be signed in to change notification settings - Fork 600
fix(iOS, FormSheet): Allow handling dynamic content size in FormSheet since 0.82 with synchronous updates enabled #3454
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
base: main
Are you sure you want to change the base?
Conversation
kkafar
left a comment
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.
This looks good. I'll check the runtime soon & will be back here.
Thanks!
kligarski
left a comment
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.
Looks good.
By the way, shouldn't synchronous state updates feature flags be enabled in our example app by default?
Imo we should have in the example app a default value that matches the default value of the flag we export. I'd prefer to have this option disabled in the app to reproduce issues with the same setup that users have. Having the same value for the flag will cover most cases. For specific examples, we'll see whether the flag is set in the code snippet. |
But in |
Yes, that was the intention, but at 2nd thought I don't have any good reason against overriding the flag in this specific example, I'll add a commit for that soon |
|
I'm okay with both solutions - just wanted to clarify it. |
kkafar
left a comment
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.
There is a weird effect with flex: 1 & fitToContents where the sheet when closed with gesture lags for a moment, before closing. Please see this video:
Screen.Recording.2025-12-08.at.12.34.30.mov
I have no idea whether it is related to these changes or not. But we need to investigate it.
The close animation, when the dimming view is clicked, works perfectly fine. Only gesture dismissal has this problem.
I can reproduce the same problem on <Text style={styles.text}>Start</Text>
<Spacer space={100} />
<Text style={styles.text}>End</Text>the issue doesn't occur, video: Screen.Recording.2025-12-08.at.12.54.42.movwith <Text style={styles.text}>Start</Text>
<Spacer space={10} />
<Text style={styles.text}>End</Text>the issue occurs, video: Screen.Recording.2025-12-08.at.12.54.16.mov |
) ## Description As discussed in #3454 (comment) , this name more precisely describes the style. ## Changes - Rename ## Test code and steps to reproduce N/A ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
|
This one is currently on hold, as it'd "stabilize" behaviour on iOS that is vastly different from what we observe on Android. Currently we decided to delve into further research on how to mitigate platform discrepancies. |
Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
I created a follow-up PR with the guidance that should cover all possible cases #3464 . I added some explanation, why we should consider proceeding with this PR and how we could align the approach between platforms when specific conditions would be met |
4620062 to
d8b4fbf
Compare
native bug, I put repro here: https://github.com/software-mansion/react-native-screens-labs/issues/705#issuecomment-3631346632 bug.mov |
kkafar
left a comment
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.
Thanks for verifying the bug I reported.
Description
Follow-up to 4605692 where I introduced a regression causing content flickering. The regression occurs when the content is allowed to dynamically adjust to the screen size (e.g., using
flex: 1in styles). The issue is caused by the asynchronous nature of the ShadowNode state update for the screen, which leads to its size being updated with a delay relative to the detent change transition.It's important to note that this issue does not occur when the update is sent synchronously. Therefore, I'd like to propose allowing
flexin screen styles when a set of conditions are met:fitToContentsdefined insheetDetents.featureFlags.experiment.synchronousScreenUpdatesEnabledinreact-native-screensis enabled (for now, the default value remains disabled).Fixes #2522
Changes
flex: 1for FormSheetScreenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
Before
Screen.Recording.2025-12-05.at.11.11.53.mov
After
Screen.Recording.2025-12-05.at.11.13.45.mov
Test code and steps to reproduce
Test2522 - covering 4 cases: {flex, fixed height} x {detents from 0.0 to 1.0, fitToContents}
Checklist