Skip to content

Commit

Permalink
fix: validation for field_input
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Dec 12, 2023
1 parent 4ac8640 commit e7c5847
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion field_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func (i *Input) Focus() tea.Cmd {
// Blur blurs the input field.
func (i *Input) Blur() tea.Cmd {
i.focused = false
*i.value = i.textinput.Value()
i.textinput.Blur()
i.err = i.validate(*i.value)
return nil
}

Expand All @@ -142,7 +144,6 @@ func (i *Input) KeyBinds() []key.Binding {
// Init initializes the input field.
func (i *Input) Init() tea.Cmd {
i.textinput.Blur()
i.err = i.validate(*i.value)
return nil
}

Expand Down

0 comments on commit e7c5847

Please sign in to comment.