Merge pull request #291 from mikeschinkel/adddropdown_init

Fix initialization bug in AddDropDown(), fixes #290.
This commit is contained in:
rivo 2019-07-05 11:34:45 +01:00 committed by GitHub
commit 4679c7790c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -209,8 +209,8 @@ func (f *Form) AddPasswordField(label, value string, fieldWidth int, mask rune,
func (f *Form) AddDropDown(label string, options []string, initialOption int, selected func(option string, optionIndex int)) *Form {
f.items = append(f.items, NewDropDown().
SetLabel(label).
SetCurrentOption(initialOption).
SetOptions(options, selected))
SetOptions(options, selected).
SetCurrentOption(initialOption))
return f
}