File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/src/main/java/com/fpf/smartscan/ui/screens/search Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,10 @@ fun SearchBar(
4141 modifier = Modifier .fillMaxWidth(),
4242 shape = RoundedCornerShape (8 .dp),
4343 keyboardActions = KeyboardActions (
44- onSearch = {onSearch(nSimilarResult, threshold)}
44+ onSearch = {
45+ if (query.isBlank()) return @KeyboardActions
46+ onSearch(nSimilarResult, threshold)
47+ }
4548 ),
4649 keyboardOptions = KeyboardOptions .Default .copy(
4750 imeAction = ImeAction .Search
@@ -50,7 +53,7 @@ fun SearchBar(
5053 Icon (
5154 imageVector = Icons .Filled .Search ,
5255 contentDescription = " Search" ,
53- tint = MaterialTheme .colorScheme.onBackground,
56+ tint = MaterialTheme .colorScheme.onBackground.copy(alpha = if (enabled) 1f else 0.3f ) ,
5457 )
5558 },
5659 trailingIcon = if (query.isNotBlank()) { {
You can’t perform that action at this time.
0 commit comments