Skip to content

Commit

Permalink
fix: set text input width dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Jun 18, 2024
1 parent 9ffcd5e commit dd1e001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ui/survey/prompt/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func NewStringModel(v recipe.Variable, styles style.Styles) StringModel {
ti := textinput.New()
ti.Focus()
ti.CharLimit = 156
ti.Width = 20

if v.Default != "" {
ti.SetValue(v.Default)
Expand Down Expand Up @@ -70,6 +69,7 @@ func (m StringModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

case tea.WindowSizeMsg:
m.width = msg.Width
m.textInput.Width = msg.Width - 3
}

m.textInput, cmd = m.textInput.Update(msg)
Expand Down

0 comments on commit dd1e001

Please sign in to comment.