Fix panic when clicking nil primitive in Flex

Resolves #20.
This commit is contained in:
Trevor Slocum 2020-06-09 15:02:17 -07:00
parent 0cb152db2b
commit 0fa19fee28
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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