From f110c26e3f24935993a311f16feb3378c38f29b4 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 7 Jul 2019 15:50:33 +0200 Subject: [PATCH] ui/input: hide soft keyboard when focus is lost Signed-off-by: Elias Naur --- ui/input/key.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/input/key.go b/ui/input/key.go index 1398d882..54afb390 100644 --- a/ui/input/key.go +++ b/ui/input/key.go @@ -48,6 +48,7 @@ func (q *keyQueue) Frame(root *ui.Ops, events handlerEvents) { delete(q.handlers, k) if q.focus == k { q.focus = nil + hide = true } } } @@ -59,6 +60,8 @@ func (q *keyQueue) Frame(root *ui.Ops, events handlerEvents) { q.focus = focus if q.focus != nil { events[q.focus] = append(events[q.focus], key.FocusEvent{Focus: true}) + } else { + hide = true } } switch {