Skip to content

Commit 882fdfe

Browse files
committed
Handle keyboard focus clearing on outer box click in GradleSettingsView
1 parent bd1f944 commit 882fdfe

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

composeApp/src/wasmJsMain/kotlin/love/forte/simbot/codegen/gen/view/GradleSettingsView.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import androidx.compose.ui.Alignment
2323
import androidx.compose.ui.Modifier
2424
import androidx.compose.ui.draw.shadow
2525
import androidx.compose.ui.graphics.Color
26+
import androidx.compose.ui.platform.LocalFocusManager
2627
import androidx.compose.ui.text.ExperimentalTextApi
2728
import androidx.compose.ui.text.buildAnnotatedString
2829
import androidx.compose.ui.text.font.FontWeight
@@ -96,17 +97,20 @@ fun GradleSettingsView(
9697
)
9798
},
9899
content = { innerPaddings ->
99-
// val focusManager = LocalFocusManager.current
100+
val focusManager = LocalFocusManager.current
100101
val scrollState = rememberScrollState()
101102
Box(
102103
modifier = Modifier
103104
.fillMaxSize()
104105
.padding(innerPaddings)
105106
.padding(top = 8.dp, bottom = 8.dp)
106-
.verticalScroll(scrollState),
107-
// .onClick {
108-
// focusManager.clearFocus()
109-
// },
107+
.verticalScroll(scrollState)
108+
.clickable(
109+
interactionSource = remember { MutableInteractionSource() },
110+
indication = null
111+
) {
112+
focusManager.clearFocus()
113+
},
110114
contentAlignment = Alignment.TopCenter,
111115
) {
112116
SettingViewContent(projectViewModel, loadingCounter)

0 commit comments

Comments
 (0)