aboutsummaryrefslogtreecommitdiff
path: root/go/ui/collection.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/ui/collection.go')
-rw-r--r--go/ui/collection.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/go/ui/collection.go b/go/ui/collection.go
index dfd5fbb5..f60f5f3b 100644
--- a/go/ui/collection.go
+++ b/go/ui/collection.go
@@ -168,7 +168,9 @@ func (c *Collection) Update() error {
w.Click(ev.X, ev.Y)
ConsumeInput(i)
}
- // TODO: switch focus
+ if w.IsFocusable() && (ev.Kind != Click || ev.Ctx.(ClickCtx).Btn == ebiten.MouseButtonLeft) {
+ c.switchFocus(w)
+ }
case Scroll, Pan:
if w.IsScrollable() {
s := ev.Ctx.(DistanceCtx)