Skip to content

Commit

Permalink
Update widget/tabcontainer.go
Browse files Browse the repository at this point in the history
Co-authored-by: Stuart Scott <stuart.murray.scott@gmail.com>
  • Loading branch information
adrianre12 and stuartmscott committed Dec 21, 2020
1 parent 02e2a8a commit 06b84ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widget/tabcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ func (c *TabContainer) RemoveIndex(index int) {
// SetItems sets the container’s items and refreshes.
func (c *TabContainer) SetItems(items []*TabItem) {
c.Items = items
if c.current >= len(c.Items) {
c.current = -1
if l := len(c.Items); c.current >= l {
c.current = l - 1
}
c.Refresh()
}
Expand Down

0 comments on commit 06b84ab

Please sign in to comment.