Skip to content

Commit

Permalink
fix(nodes): force clear TextField focus on chip button click
Browse files Browse the repository at this point in the history
closes #1228
  • Loading branch information
andrekir committed Sep 8, 2024
1 parent 4dcce57 commit e89f597
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ fun NodesScreen(
model: UIViewModel = hiltViewModel(),
chipClicked: (NodeInfo) -> Unit,
) {
val focusManager = LocalFocusManager.current
val state by model.nodesUiState.collectAsStateWithLifecycle()

val nodes by model.nodeList.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -183,7 +184,10 @@ fun NodesScreen(
distanceUnits = state.distanceUnits,
tempInFahrenheit = state.tempInFahrenheit,
isIgnored = state.ignoreIncomingList.contains(node.num),
chipClicked = { chipClicked(node) },
chipClicked = {
focusManager.clearFocus()
chipClicked(node)
},
blinking = node == focusedNode,
expanded = state.showDetails,
currentTimeMillis = currentTimeMillis
Expand Down

0 comments on commit e89f597

Please sign in to comment.