From 5f2e3a2634d3ca5f9ba9e213fafd3d418bd36bae Mon Sep 17 00:00:00 2001 From: Lynwee Hou <1507509064@qq.com> Date: Thu, 9 Jun 2022 15:38:21 +0800 Subject: [PATCH] Fix #3050, update onTapped hooker for tabButton --- container/apptabs.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/container/apptabs.go b/container/apptabs.go index 45093fa5c1..68335507c1 100644 --- a/container/apptabs.go +++ b/container/apptabs.go @@ -341,9 +341,8 @@ func (r *appTabsRenderer) buildTabButtons(count int) *fyne.Container { item := r.appTabs.Items[i] button, ok := r.buttonCache[item] if !ok { - index := i // capture button = &tabButton{ - onTapped: func() { r.appTabs.SelectIndex(index) }, + onTapped: func() { r.appTabs.Select(item) }, } r.buttonCache[item] = button }