mirror of https://github.com/rivo/tview.git
Fix initialization bug in AddDropDown(), issue #290.
This commit is contained in:
parent
384f577a62
commit
c2c3679add
4
form.go
4
form.go
|
@ -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 {
|
func (f *Form) AddDropDown(label string, options []string, initialOption int, selected func(option string, optionIndex int)) *Form {
|
||||||
f.items = append(f.items, NewDropDown().
|
f.items = append(f.items, NewDropDown().
|
||||||
SetLabel(label).
|
SetLabel(label).
|
||||||
SetCurrentOption(initialOption).
|
SetOptions(options, selected).
|
||||||
SetOptions(options, selected))
|
SetCurrentOption(initialOption))
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue