Skip to content

Conversation

@qamarelsafadi
Copy link
Contributor

This PR fixes an issue where the PagerState in the CreationScreen was resetting to the initial page (index 0) after a configuration change, such as screen rotation. #31

Problem

On screen rotation, PagerState was re-created with the hardcoded initial page index 0, causing the pager to always reset to the first page. This is because the previous state was not preserved across recompositions caused by configuration changes.

Solution

Instead of hardcoding the initial page index to 0, we now use the current selection (uiState.selectedPromptOption.ordinal) to initialize the pager correctly after recomposition or configuration changes.

Recording

Issue Fix
Screen_recording_20250524_015546.mp4
Screen_recording_20250524_020620.mp4

@riggaroo riggaroo merged commit f84eab3 into android:main May 29, 2025
3 checks passed
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.

3 participants