Skip to content

Commit

Permalink
make column scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Feb 19, 2024
1 parent 1d0c176 commit 84c236b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -30,10 +32,12 @@ fun ShinApp() {
snackbarHost = { SnackbarHost(hostState = snackbarHostState) }
) {
var shortenedUrl by remember<MutableState<String?>> { mutableStateOf(null) }
val scrollState = rememberScrollState()
Column(
modifier = Modifier
.fillMaxSize()
.onKeyEvent { event -> event.isEscDown.also { if (it) shortenedUrl = null } },
.onKeyEvent { event -> event.isEscDown.also { if (it) shortenedUrl = null } }
.verticalScroll(scrollState),
verticalArrangement = Arrangement.Center,
) {
Text(
Expand Down

0 comments on commit 84c236b

Please sign in to comment.