Skip to content
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

[core] Fix Index Reset for Tabs in Small Deck Layout #93

Merged

Conversation

ricoberger
Copy link
Member

The index was not reset in the DeckLayoutSmall widget, when the user selected a new deck in the settings widget. This was caused because the DefaultTabController was not rebuild after a new deck was selected, so that the initialIndex value was not used.

This is now fixed by adding a key to the DefaultTabController, which corresponds to the selected deck. This means if the user selects a new deck in the settings the widget will be rebuild and the initial selected tab will be the first one. If a user selects the same deck or switches between the small and large layout the tab will be the formerly selected one.

The index was not reset in the `DeckLayoutSmall` widget, when the user
selected a new deck in the settings widget. This was caused because the
`DefaultTabController` was not rebuild after a new deck was selected, so
that the `initialIndex` value was not used.

This is now fixed by adding a `key` to the `DefaultTabController`, which
corresponds to the selected deck. This means if the user selects a new
deck in the settings the widget will be rebuild and the initial selected
tab will be the first one. If a user selects the same deck or switches
between the small and large layout the tab will be the formerly selected
one.
@ricoberger ricoberger self-assigned this Dec 1, 2023
@ricoberger ricoberger added the changelog: fixed Something which wasn't working is fixed label Dec 1, 2023
@ricoberger ricoberger added this to the v1.3.0 milestone Dec 1, 2023
@ricoberger ricoberger merged commit eb28a44 into main Dec 1, 2023
9 checks passed
@ricoberger ricoberger deleted the core-fix-index-reset-for-tabs-in-small-deck-layout branch December 1, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fixed Something which wasn't working is fixed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant