From 84f9c0ff9de89a76376809cf5aa220e840a65c6d Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:52:35 +0100 Subject: [PATCH] Clicking on a form outside a form item will focus it. Fixes #793 --- README.md | 2 +- form.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 321b912..8badcd4 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ For a presentation highlighting this package, compile and run the program found ## Projects using `tview` +- [K9s - Kubernetes CLI](https://github.com/derailed/k9s) - [IRCCloud Terminal Client](https://github.com/termoose/irccloud) - [Window manager for `tview`](https://github.com/epiclabs-io/winman) - [CLI bookmark manager](https://github.com/Endi1/drawer) @@ -62,7 +63,6 @@ For a presentation highlighting this package, compile and run the program found - [Terminal UI for todist](https://github.com/cyberdummy/todoista) - [Graphical kubectl wrapper](https://github.com/dcaiafa/kpick) - [Decred Decentralized Exchange ](https://github.com/decred/dcrdex) -- [Kubernetes CLI To Manage Your Clusters In Style! ](https://github.com/derailed/k9s) - [A CLI file browser for Raspberry PI](https://github.com/destinmoulton/pixi) - [A tool to manage projects.](https://github.com/divramod/dp) - [A simple app for BMI monitoring](https://github.com/erleene/go-bmi) diff --git a/form.go b/form.go index ee96d6d..de0be8a 100644 --- a/form.go +++ b/form.go @@ -802,6 +802,7 @@ func (f *Form) MouseHandler() func(action MouseAction, event *tcell.EventMouse, // A mouse down anywhere else will return the focus to the last selected // element. if action == MouseLeftDown && f.InRect(event.Position()) { + f.Focus(setFocus) consumed = true }