Skip to content

Commit

Permalink
Merge pull request #249 from tarkalabs/mahi/enhance/TUISearchBar
Browse files Browse the repository at this point in the history
initial Focus made as optional in TUISearchBar
  • Loading branch information
NandagopalR authored Jun 13, 2024
2 parents 7e2bc88 + f438833 commit 50234da
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ import kotlinx.coroutines.delay
onQueryTextChange: (String) -> Unit,
leadingIcon: TarkaIcon? = null,
onLeadingIconClick: (() -> Unit)? = null,
isInitialAutoFocus: Boolean = true,
searchBarTags: TUISearchBarTags = TUISearchBarTags(),
) {
val focusRequester = remember { FocusRequester() }

LaunchedEffect(Unit) {
delay(500)
focusRequester.requestFocus()
LaunchedEffect(isInitialAutoFocus) {
if (isInitialAutoFocus) {
delay(500)
focusRequester.requestFocus()
}
}

val leadingIconLambda: @Composable (() -> Unit)? = if (leadingIcon != null) {
Expand Down

0 comments on commit 50234da

Please sign in to comment.