Skip to content

Commit

Permalink
chore(survey): add todo about the max width
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Jan 26, 2024
1 parent 6fd6ed5 commit 786f4e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ui/editable/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type Model struct {
focus bool
optional bool

width int

styles Styles
table *table.Table
}
Expand Down Expand Up @@ -228,6 +230,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if cmd != nil {
return m, cmd
}
case tea.WindowSizeMsg:
m.width = msg.Width
}

m.rows[m.cursorY][m.cursorX].input, cmd = m.rows[m.cursorY][m.cursorX].input.Update(msg)
Expand Down Expand Up @@ -259,6 +263,8 @@ func (m Model) View() string {
Data(m).
Render())

// TODO: Use m.width to manage the max width of the table

s.WriteRune('\n')
if errs := m.Errors(); len(errs) != 0 {
for _, err := range errs {
Expand Down

0 comments on commit 786f4e2

Please sign in to comment.