Skip to content

Commit

Permalink
fix: focusing when is hide
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgerojas26 committed Sep 7, 2024
1 parent a5e6a4f commit 9c693f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/ResultsTable.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func (table *ResultsTable) subscribeToSidebarChanges() {
case "Unfocusing":
App.SetFocus(table)
App.ForceDraw()
case "Toggling":
table.ShowSidebar(false)
App.ForceDraw()
}
}
}
Expand Down Expand Up @@ -398,7 +401,9 @@ func (table *ResultsTable) tableInputCapture(event *tcell.EventKey) *tcell.Event
} else if command == commands.ToggleSidebar {
table.ShowSidebar(!table.GetShowSidebar())
} else if command == commands.FocusSidebar {
App.SetFocus(table.Sidebar)
if table.GetShowSidebar() {
App.SetFocus(table.Sidebar)
}
}

if len(table.GetRecords()) > 0 {
Expand Down Expand Up @@ -1270,6 +1275,7 @@ func (table *ResultsTable) ShowSidebar(show bool) {
table.Page.ShowPage(SidebarPageName)
} else {
table.Page.HidePage(SidebarPageName)
App.SetFocus(table)
}
}

Expand Down

0 comments on commit 9c693f5

Please sign in to comment.