Skip to content

Fix: Screen rotation (from landscape to portait) causes bottom sheet to open #2597

Open
unstoo wants to merge 1 commit intogorhom:masterfrom
unstoo:fix/getEvaluatedPosition-undefined-when-closed
Open

Fix: Screen rotation (from landscape to portait) causes bottom sheet to open #2597
unstoo wants to merge 1 commit intogorhom:masterfrom
unstoo:fix/getEvaluatedPosition-undefined-when-closed

Conversation

@unstoo
Copy link

@unstoo unstoo commented Jan 19, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant