Skip to content

Commit

Permalink
도시선택후 드롭다운 안보이게 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
leesa-l committed Dec 29, 2023
1 parent bafb6d9 commit bf52abd
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fun WhereContents(
val stepState by viewModel.state.collectAsState()
val countryList by viewModel.countryList.collectAsState()
var input by remember { mutableStateOf("") }
var selectedCountry by remember { mutableStateOf("") }
val keyboardController = LocalSoftwareKeyboardController.current
val focusManager = LocalFocusManager.current
val searchEvent = remember {
Expand Down Expand Up @@ -122,17 +123,21 @@ fun WhereContents(
}
)
Spacer(modifier = Modifier.height(11.dp))

Box(modifier = Modifier.weight(1f)) {
CountryList(
modifier = Modifier.fillMaxWidth(),
countryList = countryList,
onClick = { country ->
keyboardController?.hide()
focusManager.clearFocus()
input = country.text
viewModel.onClickCountry(country)
}
)
if (selectedCountry != input) {
CountryList(
modifier = Modifier.fillMaxWidth(),
countryList = countryList,
onClick = { country ->
keyboardController?.hide()
focusManager.clearFocus()
input = country.text
selectedCountry = input
viewModel.onClickCountry(country)
}
)
}
}
Spacer(modifier = Modifier.height(8.dp))
ChevitButtonFillLarge(
Expand Down

0 comments on commit bf52abd

Please sign in to comment.