1
0
mirror of https://github.com/rivo/tview.git synced 2025-04-24 13:48:56 +08:00

Bugfix: TreeView mouse events need to consider scroll offset. Fixes #528

This commit is contained in:
Oliver 2020-11-17 15:08:43 +01:00
parent 273cbf289d
commit 237e3862e0

View File

@ -744,7 +744,7 @@ func (t *TreeView) MouseHandler() func(action MouseAction, event *tcell.EventMou
case MouseLeftClick:
setFocus(t)
_, rectY, _, _ := t.GetInnerRect()
y -= rectY
y += t.offsetY - rectY
if y >= 0 && y < len(t.nodes) {
node := t.nodes[y]
if node.selectable {