Skip to content

Commit 66dbd5c

Browse files
kap1210kalpesh
and
kalpesh
authored
MW-168: enhancement: Keyboard will close automatically when we change tabs (#1858)
Co-authored-by: kalpesh <[email protected]>
1 parent 3061265 commit 66dbd5c

File tree

1 file changed

+9
-0
lines changed
  • feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments

1 file changed

+9
-0
lines changed

Diff for: feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/PaymentsScreen.kt

+9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import androidx.compose.foundation.layout.Column
1313
import androidx.compose.foundation.layout.fillMaxSize
1414
import androidx.compose.foundation.pager.rememberPagerState
1515
import androidx.compose.runtime.Composable
16+
import androidx.compose.runtime.LaunchedEffect
1617
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
1719
import org.jetbrains.compose.ui.tooling.preview.Preview
1820
import org.mifospay.core.ui.MifosScrollableTabRow
1921
import org.mifospay.core.ui.utility.TabContent
@@ -36,6 +38,13 @@ private fun PaymentScreenContent(
3638
) {
3739
val pagerState = rememberPagerState(pageCount = { tabContents.size })
3840

41+
val keyboardController = LocalSoftwareKeyboardController.current
42+
LaunchedEffect(
43+
pagerState.currentPage,
44+
) {
45+
keyboardController?.hide()
46+
}
47+
3948
Column(
4049
modifier = modifier
4150
.fillMaxSize(),

0 commit comments

Comments
 (0)