Skip to content

Commit

Permalink
Fixes #1451
Browse files Browse the repository at this point in the history
  • Loading branch information
mtotschnig committed Mar 15, 2024
1 parent fb2ef0d commit b4e9aaa
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.widget.PopupMenu
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.collectIsDraggedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
Expand Down Expand Up @@ -847,8 +848,11 @@ abstract class BaseMyExpenses : LaunchActivity(), OcrHost, OnDialogResultListene
pagerState.scrollToPage(currentPage)
}
}
val isDragged = pagerState.interactionSource.collectIsDraggedAsState().value
LaunchedEffect(pagerState.currentPage) {
selectedAccountId = accountData[pagerState.currentPage].id
if (isDragged) {
selectedAccountId = accountData[pagerState.currentPage].id
}
}
HorizontalPager(
modifier = Modifier
Expand Down

0 comments on commit b4e9aaa

Please sign in to comment.