From 84c236beed3575870b9585f1cc14571d2d798f05 Mon Sep 17 00:00:00 2001 From: Maciej Procyk Date: Mon, 19 Feb 2024 01:20:01 +0100 Subject: [PATCH] make column scrollable --- composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt b/composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt index 53982d8..d433f9c 100644 --- a/composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt +++ b/composeApp/src/commonMain/kotlin/in/procyk/shin/App.kt @@ -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 @@ -30,10 +32,12 @@ fun ShinApp() { snackbarHost = { SnackbarHost(hostState = snackbarHostState) } ) { var shortenedUrl by remember> { 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(