Fix: Screen rotation (from landscape to portait) causes bottom sheet to open #2597
Open
unstoo wants to merge 1 commit intogorhom:masterfrom
Open
Fix: Screen rotation (from landscape to portait) causes bottom sheet to open #2597unstoo wants to merge 1 commit intogorhom:masterfrom
unstoo wants to merge 1 commit intogorhom:masterfrom
Conversation
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.
Bug: Screen rotation (from landscape to portait) causes bottom sheet to open
Fixed getEvaluatedPosition returning undefined when the bottom sheet is closed (currentIndex === -1).
Problem
When the sheet is closed, accessing detents[-1] returns undefined, which prevents the sheet from updating its position correctly during device rotation or when snap points change.
Solution
Added a check to return closedDetentPosition when currentIndex === -1, instead of accessing detents[-1].
Testing
Verified position updates correctly during device rotation when sheet is closed
Confirmed evaluatedPosition is no longer undefined when currentIndex === -1