Repository navigation
Conversation
|
Someone is attempting to deploy a commit to the lodev09 Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Android a
detentschange that lands whilepresent()runs is lost: the behavior keeps the stops it was configured with, while the container follows the new detents.How it happens:
present()callssetupSheetDetents()beforeisPresented = true. ItsupdateStateDimensions()resizes the container through the Fabric state, and Fabric mounts the pending props right there. If those props carry newdetents,setDetentsstores them, butfinalizeUpdates()skipsupdateSheetIfNeeded()becauseisPresentedis still false. After that nothing reconfigures the behavior.The result: the sheet settles at the old half-expanded/expanded offsets, while
updateStateDimensions()sizes the container to the new detents. When the new stops are lower, the content ends partway down the sheet and the rest of the sheet is empty. During a drag the container follows the finger, so the content shows up and disappears again when the sheet settles.We hit this with detents computed from measured content: the first detents are estimates and the real ones arrive while the sheet is presenting. Logs from the device:
The fix: at the end of
present(), onceisPresentedis true, reconfigure withapplyState = falseif the detents differ from the configured ones. The posted present settle then uses the new stops. This looks like the Android side of #555.Type of Change
Test Plan
Tested on 4.1.0 through patch-package, RN 0.88, Xiaomi POCO F5 (Android 15):
present()and the sheet settles at the new stops.setupSheetDetentsForSizeChange().Checklist