Skip to content

Commit

Permalink
[ANDROAPP-5800] Not loop on next click when gets the last item
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr committed Feb 22, 2024
1 parent efc1063 commit 9324f0e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ fun SearchParametersScreen(
fieldUiModel = fieldUiModel,
callback = callback,
onNextClicked = {
val nextItemIndex = (index + 1) % uiState.items.size
uiState.items[nextItemIndex].onItemClick()
val nextIndex = index + 1
if (nextIndex < uiState.items.size) {
uiState.items[nextIndex].onItemClick()
}
},
),
)
Expand Down

0 comments on commit 9324f0e

Please sign in to comment.