From e89f59745d262a561d299de967cb53c325e1ce0a Mon Sep 17 00:00:00 2001 From: andrekir Date: Sun, 8 Sep 2024 08:27:38 -0300 Subject: [PATCH] fix(nodes): force clear TextField focus on chip button click closes #1228 --- app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt index 2e9d509a..eedd5eb9 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/UsersFragment.kt @@ -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() @@ -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