2
0
mirror of https://github.com/rivo/tview.git synced 2024-11-12 19:10:28 +00:00

Allow changing focus in handler

This commit is contained in:
Chris Miller 2020-04-17 02:16:20 +00:00
parent 7b79cb6347
commit 089ac467f8

View File

@ -742,6 +742,7 @@ func (t *TreeView) MouseHandler() func(action MouseAction, event *tcell.EventMou
switch action {
case MouseLeftClick:
setFocus(t)
_, rectY, _, _ := t.GetInnerRect()
y -= rectY
if y >= 0 && y < len(t.nodes) {
@ -758,7 +759,6 @@ func (t *TreeView) MouseHandler() func(action MouseAction, event *tcell.EventMou
}
}
consumed = true
setFocus(t)
case MouseScrollUp:
t.movement = treeUp
consumed = true