Browse Source

Set DropDown options list width to at least as wide as the originating field

tablepad
Trevor Slocum 2 years ago
parent
commit
97f450fc34
  1. 3
      dropdown.go

3
dropdown.go

@ -661,6 +661,9 @@ func (d *DropDown) Draw(screen tcell.Screen) {
if d.list.scrollBarVisibility == ScrollBarAlways || (d.list.scrollBarVisibility == ScrollBarAuto && len(d.options) > lheight) {
lwidth++ // Add space for scroll bar
}
if lwidth < fieldWidth {
lwidth = fieldWidth
}
d.list.SetRect(lx, ly, lwidth, lheight)
d.list.Draw(screen)
}

Loading…
Cancel
Save