Skip to content

Commit

Permalink
[FEATURE] #125 : auth 모듈 TextField 외부 클릭시 Focus 해제되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 16, 2024
1 parent bc73e43 commit 3bad560
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand All @@ -38,6 +39,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.wap.designsystem.WappTheme
import com.wap.designsystem.modifier.addFocusCleaner
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.core.domain.model.AuthState
import com.wap.wapp.core.domain.usecase.auth.SignInUseCase
Expand Down Expand Up @@ -69,6 +71,7 @@ internal fun SignInScreen(
val snackBarHostState = remember { SnackbarHostState() }
var email by rememberSaveable { mutableStateOf("") }
val keyboardController = LocalSoftwareKeyboardController.current
val focusManager = LocalFocusManager.current

BottomSheetScaffold(
scaffoldState = scaffoldState,
Expand All @@ -79,7 +82,9 @@ internal fun SignInScreen(
modifier = Modifier.fillMaxSize(),
sheetContent = {
Column(
modifier = Modifier.padding(16.dp),
modifier = Modifier
.padding(16.dp)
.addFocusCleaner(focusManager),
) {
Text(
modifier = Modifier.align(Alignment.CenterHorizontally),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand All @@ -34,6 +35,7 @@ import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.wap.designsystem.WappTheme
import com.wap.designsystem.component.WappSubTopBar
import com.wap.designsystem.modifier.addFocusCleaner
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.core.designresource.R
import com.wap.wapp.feature.auth.R.drawable.ic_card
Expand Down Expand Up @@ -64,6 +66,7 @@ internal fun SignUpScreen(
) {
val snackBarHostState = remember { SnackbarHostState() }
val keyboardController = LocalSoftwareKeyboardController.current
val focusManager = LocalFocusManager.current

LaunchedEffect(true) {
viewModel.signUpEventFlow.collectLatest {
Expand All @@ -89,6 +92,7 @@ internal fun SignUpScreen(
Column(
modifier = Modifier
.fillMaxSize()
.addFocusCleaner(focusManager)
.padding(horizontal = 16.dp),
) {
WappSubTopBar(
Expand Down

0 comments on commit 3bad560

Please sign in to comment.