From aad810dfbce6008f9f66c157f4790e41a29deffb Mon Sep 17 00:00:00 2001 From: Sculas Date: Wed, 27 Nov 2024 13:57:41 +0100 Subject: [PATCH] fix(input): Skip validation when going to previous field (#285) In my opinion, this would make user experience better. Say you made a typo in the previous field but you already went to the next one, now you *need* to fill the current field correctly before you can fix the previous field. This also keeps validation intact, because the field still needs to be valid to progress to the next field. --- field_input.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/field_input.go b/field_input.go index 3510d527..8cf137e3 100644 --- a/field_input.go +++ b/field_input.go @@ -342,11 +342,6 @@ func (i *Input) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch { case key.Matches(msg, i.keymap.Prev): - value := i.textinput.Value() - i.err = i.validate(value) - if i.err != nil { - return i, nil - } cmds = append(cmds, PrevField) case key.Matches(msg, i.keymap.Next, i.keymap.Submit): value := i.textinput.Value()