File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/kotlin/com/jetpackduba/gitnuro/ui Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import androidx.compose.ui.graphics.Color
26
26
import androidx.compose.ui.graphics.ColorFilter
27
27
import androidx.compose.ui.graphics.painter.Painter
28
28
import androidx.compose.ui.input.key.KeyEventType
29
+ import androidx.compose.ui.input.key.onKeyEvent
29
30
import androidx.compose.ui.input.key.onPreviewKeyEvent
30
31
import androidx.compose.ui.input.key.type
31
32
import androidx.compose.ui.text.font.FontWeight
@@ -381,7 +382,14 @@ fun RecentRepositoriesList(
381
382
AdjustableOutlinedTextField (
382
383
modifier = Modifier
383
384
.focusRequester(searchFieldFocusRequester)
384
- .onFocusChanged { isSearchFocused = it.isFocused },
385
+ .onFocusChanged { isSearchFocused = it.isFocused }
386
+ .onPreviewKeyEvent { keyEvent ->
387
+ if (keyEvent.matchesBinding(KeybindingOption .EXIT ) && keyEvent.type == KeyEventType .KeyDown ) {
388
+ filter = " "
389
+ true
390
+ } else
391
+ false
392
+ },
385
393
value = filter,
386
394
onValueChange = { filter = it },
387
395
singleLine = true ,
You can’t perform that action at this time.
0 commit comments