Skip to content

Commit

Permalink
Merge pull request #2940 from weaveworks/fix-input-angle-bracket-and-…
Browse files Browse the repository at this point in the history
…space-on-submit

Fix the last input not highlighted on focus properly.
  • Loading branch information
opudrovs authored Oct 27, 2022
2 parents f96486d + 40b25f8 commit 142dd73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/run/bootstrap/bootstrap_wizard_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (m wizardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

cmdsTextInputs := []tea.Cmd{}

for i, input := range m.inputs[:len(m.inputs)-1] {
for i, input := range m.inputs[:len(m.inputs)] {
if input.inputType == bootstrapWizardInputTypeCheckbox {
continue
}
Expand All @@ -386,9 +386,13 @@ func (m wizardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

cmds = append(cmds, cmdsTextInputs...)
case tea.KeySpace:
if m.focusIndex == len(m.inputs) {
return m, nil
}

input := m.inputs[m.focusIndex]

if m.focusIndex == len(m.inputs) || input.inputType != bootstrapWizardInputTypeCheckbox {
if input.inputType != bootstrapWizardInputTypeCheckbox {
break
}

Expand Down

0 comments on commit 142dd73

Please sign in to comment.