Skip to content

Commit

Permalink
fix: tasks widget lost focus from sidebar (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
prgres authored May 23, 2024
1 parent 0d8136d commit 287af12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions ui/components/views-tabs/viewstabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import (
const WidgetId = "widgetTasksTabs"

type Tab struct {
Name string
Type string
Id string
Active bool
Name string
Id string
}

type Model struct {
Expand Down
5 changes: 1 addition & 4 deletions ui/views/compact/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,10 @@ func InitialModel(ctx *context.UserContext, logger *log.Logger) common.View {
func viewsToTabs(views []clickup.View) []viewstabs.Tab {
tabs := make([]viewstabs.Tab, len(views))
for i, view := range views {
tabView := viewstabs.Tab{
tabs[i] = viewstabs.Tab{
Name: view.Name,
Type: "view",
Id: view.Id,
// Active: false,
}
tabs[i] = tabView
}

return tabs
Expand Down
3 changes: 2 additions & 1 deletion ui/widgets/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,15 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
case m.componenetTasksTable.ComponentId:
m.componenetTasksSidebar.SetFocused(false)
m.componenetTasksTable.SetFocused(false)

cmds = append(cmds, LostFocusCmd())
}

m.componenetTasksSidebar, cmd = m.componenetTasksSidebar.Update(msg)
cmds = append(cmds, cmd)
m.componenetTasksTable, cmd = m.componenetTasksTable.Update(msg)
cmds = append(cmds, cmd)

cmds = append(cmds, LostFocusCmd())
return m, tea.Batch(cmds...)
}

Expand Down

0 comments on commit 287af12

Please sign in to comment.