[GH-ISSUE #796] Mouse Wheel Scrolling not Working for TreeView When Application Has Mouse Enabled #585

Closed
opened 2026-03-04 01:06:14 +03:00 by kerem · 2 comments
Owner

Originally created by @SolarLune on GitHub (Jan 18, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/796

Hello - firstly, really love tview and this framework - it's fantastic! Thanks a ton for creating it and continually working on it! It's driving TetraTerm, my remote scene visualization tool for games made with my 3D renderer Tetra3D. Really loving how flexibly it displays while working from a terminal.

The issue I'm having is that when an Application has mouse support enabled via Application.EnableMouse(true), TreeViews can no longer scroll using the mouse wheel. Here's a reproduction program adapted from the example in the wiki for TreeViews:


package main

import (
	"github.com/rivo/tview"
)

func main() {

	root := tview.NewTreeNode("Root")

        // Create enough nodes to need to scroll
	for i := 0; i < 20; i++ {
		root.AddChild(tview.NewTreeNode("Node"))
	}

	tree := tview.NewTreeView().SetRoot(root).SetCurrentNode(root)

	app := tview.NewApplication().SetRoot(tree, true)

	// Uncomment the line below and scrolling with the wheel stops working
	// app.EnableMouse(true)

	if err := app.Run(); err != nil {
		panic(err)
	}

}

This example works fine, but if you uncomment the app.EnableMouse(true) line above, the mouse wheel no longer scrolls the tree view.

Originally created by @SolarLune on GitHub (Jan 18, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/796 Hello - firstly, really love tview and this framework - it's fantastic! Thanks a ton for creating it and continually working on it! It's driving [TetraTerm](https://github.com/SolarLune/tetraterm), my remote scene visualization tool for games made with my 3D renderer [Tetra3D](https://github.com/SolarLune/tetra3d). Really loving how flexibly it displays while working from a terminal. The issue I'm having is that when an Application has mouse support enabled via `Application.EnableMouse(true)`, TreeViews can no longer scroll using the mouse wheel. Here's a reproduction program adapted from the example in the wiki for TreeViews: ```go package main import ( "github.com/rivo/tview" ) func main() { root := tview.NewTreeNode("Root") // Create enough nodes to need to scroll for i := 0; i < 20; i++ { root.AddChild(tview.NewTreeNode("Node")) } tree := tview.NewTreeView().SetRoot(root).SetCurrentNode(root) app := tview.NewApplication().SetRoot(tree, true) // Uncomment the line below and scrolling with the wheel stops working // app.EnableMouse(true) if err := app.Run(); err != nil { panic(err) } } ``` This example works fine, but if you uncomment the `app.EnableMouse(true)` line above, the mouse wheel no longer scrolls the tree view.
kerem closed this issue 2026-03-04 01:06:14 +03:00
Author
Owner

@SolarLune commented on GitHub (Feb 5, 2023):

Hello, I missed this - no, I'm on Fedora Linux 37, fully updated. Sorry for forgetting to say it~

<!-- gh-comment-id:1418250242 --> @SolarLune commented on GitHub (Feb 5, 2023): Hello, I missed this - no, I'm on Fedora Linux 37, fully updated. Sorry for forgetting to say it~
Author
Owner

@rivo commented on GitHub (Mar 30, 2023):

Thanks for letting me know about this. It should be fixed with the latest commit.

<!-- gh-comment-id:1490750326 --> @rivo commented on GitHub (Mar 30, 2023): Thanks for letting me know about this. It should be fixed with the latest commit.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#585
No description provided.