Skip to content

Commit

Permalink
feat: make navigation drawer scrollable (closes #139)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Oct 16, 2023
1 parent e91ebdd commit f4d0252
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Divider
import androidx.compose.material3.DrawerDefaults
import androidx.compose.material3.DrawerState
Expand Down Expand Up @@ -69,7 +71,13 @@ fun NavigationDrawer(
ModalNavigationDrawer(
drawerState = drawerState,
drawerContent = {
ModalDrawerSheet {
val scrollState = rememberScrollState()

ModalDrawerSheet(
modifier = Modifier
.fillMaxHeight()
.verticalScroll(scrollState),
) {
Spacer(Modifier.height(20.dp))
Row(
verticalAlignment = Alignment.CenterVertically
Expand Down

0 comments on commit f4d0252

Please sign in to comment.