Skip to content

Commit

Permalink
Fix flickering when navigating to drawer screens
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam committed Mar 18, 2024
1 parent 02eb1af commit 5d53338
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ fun HomeScreenContent(
label = { Text(stringResource(id = item.nameResId)) },
selected = item == selectedItem.value,
onClick = {
coroutineScope.launch { drawerState.close() }
selectedItem.value = item
navController.navigate(item.route)
coroutineScope.launch {
drawerState.close()
navController.navigate(item.route)
}
},
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
)
Expand Down

0 comments on commit 5d53338

Please sign in to comment.