File tree Expand file tree Collapse file tree
feature/search/src/main/java/com/terning/feature/search/searchprocess Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ import androidx.compose.runtime.Composable
1616import androidx.compose.runtime.LaunchedEffect
1717import androidx.compose.runtime.getValue
1818import androidx.compose.runtime.mutableIntStateOf
19+ import androidx.compose.runtime.mutableStateOf
1920import androidx.compose.runtime.remember
21+ import androidx.compose.runtime.saveable.rememberSaveable
22+ import androidx.compose.runtime.setValue
2023import androidx.compose.ui.Alignment
2124import androidx.compose.ui.Modifier
2225import androidx.compose.ui.focus.FocusRequester
@@ -159,6 +162,7 @@ fun SearchProcessScreen(
159162 val focusRequester = remember { FocusRequester () }
160163 val focusManager = LocalFocusManager .current
161164 val currentSortBy = remember { mutableIntStateOf(state.currentSortBy) }
165+ var isInitialFocusSet by rememberSaveable { mutableStateOf(false ) }
162166
163167 val amplitudeTracker = LocalTracker .current
164168
@@ -172,10 +176,15 @@ fun SearchProcessScreen(
172176 }
173177 }
174178
179+
175180 LaunchedEffect (Unit ) {
176- focusRequester.requestFocus()
181+ if (! isInitialFocusSet) {
182+ focusRequester.requestFocus()
183+ isInitialFocusSet = true
184+ }
177185 }
178186
187+
179188 Column (
180189 modifier = Modifier
181190 .background(White )
You can’t perform that action at this time.
0 commit comments