Skip to content

Commit

Permalink
Allow OnSelected of a tab to focus content
Browse files Browse the repository at this point in the history
It was a refresh order issue - focus manager could not "see" new item

Fixes #5454
  • Loading branch information
andydotxyz committed Jan 27, 2025
1 parent e400de7 commit c750757
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions container/apptabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,11 @@ func (t *AppTabs) RemoveIndex(index int) {
// Select sets the specified TabItem to be selected and its content visible.
func (t *AppTabs) Select(item *TabItem) {
selectItem(t, item)
t.Refresh()
}

// SelectIndex sets the TabItem at the specific index to be selected and its content visible.
func (t *AppTabs) SelectIndex(index int) {
selectIndex(t, index)
t.Refresh()
}

// SelectTab sets the specified TabItem to be selected and its content visible.
Expand Down
1 change: 0 additions & 1 deletion container/doctabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ func (t *DocTabs) Select(item *TabItem) {
// SelectIndex sets the TabItem at the specific index to be selected and its content visible.
func (t *DocTabs) SelectIndex(index int) {
selectIndex(t, index)
t.Refresh()
}

// Selected returns the currently selected TabItem.
Expand Down
1 change: 1 addition & 0 deletions container/tabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func selectIndex(t baseTabs, index int) {

t.setTransitioning(true)
t.setSelected(index)
t.Refresh()

if f := t.onSelected(); f != nil {
// Notification of selected
Expand Down

0 comments on commit c750757

Please sign in to comment.