From 6713a8f4588f26f46c3e5fe0a69ead0f345617f3 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Wed, 2 Aug 2023 11:54:13 +0200 Subject: wizard: display warning when focus is lost Display the warning that the password is stored in plaintext after the focus of the password input field is lost. The current behavior of showing the warning after the first character is entered is ackward and confusing. It also eliminates the need to debounce the warning when a password is pasted. Reported-by: Brad Signed-off-by: Koni Marti Acked-by: Robin Jarry --- lib/ui/tab.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/ui') diff --git a/lib/ui/tab.go b/lib/ui/tab.go index b62764fb..6a5cbf50 100644 --- a/lib/ui/tab.go +++ b/lib/ui/tab.go @@ -157,6 +157,9 @@ func (tabs *Tabs) selectPriv(index int) bool { if vis, ok := prev.Content.(Visible); ok { vis.Show(false) } + if vis, ok := prev.Content.(Interactive); ok { + vis.Focus(false) + } tabs.pushHistory(tabs.curIndex) } tabs.curIndex = index @@ -164,6 +167,9 @@ func (tabs *Tabs) selectPriv(index int) bool { if vis, ok := next.Content.(Visible); ok { vis.Show(true) } + if vis, ok := next.Content.(Interactive); ok { + vis.Focus(true) + } Invalidate() } return true -- cgit