Browse Source

Fix panic when clicking nil primitive in Flex

Resolves #20.
tablepad
Trevor Slocum 2 years ago
parent
commit
0fa19fee28
  1. 1
      CHANGELOG
  2. 4
      flex.go

1
CHANGELOG

@ -3,6 +3,7 @@ v1.4.7 (WIP)
- Add List.SetSelectedAlwaysCentered
- Fix default background transparency of Flex and Grid
- Fix negative List offset and DropDown selection
- Fix panic when clicking nil primitive in Flex
- Fix ANSI colors 0-15
- Fix ANSI SGR codes

4
flex.go

@ -232,6 +232,10 @@ func (f *Flex) MouseHandler() func(action MouseAction, event *tcell.EventMouse,
// Pass mouse events along to the first child item that takes it.
for _, item := range f.items {
if item.Item == nil {
continue
}
consumed, capture = item.Item.MouseHandler()(action, event, setFocus)
if consumed {
return

Loading…
Cancel
Save