[GH-ISSUE #600] Items in a DropDown primitive can be selected from outside it's boundaries #439

Closed
opened 2026-03-04 01:05:02 +03:00 by kerem · 1 comment
Owner

Originally created by @AmrGanz on GitHub (May 14, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/600

While enabling the mouse, and after creating a DropDown one can select one of the options while not clicking directly on the DropDown area. Please check the attached screen recording.

https://user-images.githubusercontent.com/43642001/118298201-389e9600-b4f0-11eb-805e-6009db9ecef3.mp4

The code I was running:

package main

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

var app = tview.NewApplication()
var grid1 = tview.NewGrid()
var header = tview.NewTextView()
var dropbox = tview.NewDropDown()
var list1 = tview.NewList()
var textview = tview.NewTextView()

func main() {
	list1.ShowSecondaryText(false).
		AddItem("option1", "", 0, nil).
		AddItem("option2", "", 0, nil).
		AddItem("option3", "", 0, nil)
	textview.SetText("hello there!!!")
	dropbox.SetTitle("Items")
	dropbox.AddOption("item1", nil).
		AddOption("item2", nil).
		AddOption("item3", nil)
	grid1.SetRows(4, 2, 0).
		SetColumns(10, 10, 0, 10).
		SetBorders(true).
		AddItem(header, 0, 0, 1, 4, 0, 0, true).
		AddItem(dropbox, 1, 0, 1, 1, 0, 0, false).
		AddItem(list1, 2, 0, 1, 1, 0, 0, false).
		AddItem(textview, 1, 1, 2, 3, 0, 0, false)
	app.SetRoot(grid1, true).EnableMouse(true).Run()
}
Originally created by @AmrGanz on GitHub (May 14, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/600 While enabling the mouse, and after creating a `DropDown` one can select one of the options while not clicking directly on the `DropDown` area. Please check the attached screen recording. https://user-images.githubusercontent.com/43642001/118298201-389e9600-b4f0-11eb-805e-6009db9ecef3.mp4 The code I was running: ``` package main import ( "github.com/rivo/tview" ) var app = tview.NewApplication() var grid1 = tview.NewGrid() var header = tview.NewTextView() var dropbox = tview.NewDropDown() var list1 = tview.NewList() var textview = tview.NewTextView() func main() { list1.ShowSecondaryText(false). AddItem("option1", "", 0, nil). AddItem("option2", "", 0, nil). AddItem("option3", "", 0, nil) textview.SetText("hello there!!!") dropbox.SetTitle("Items") dropbox.AddOption("item1", nil). AddOption("item2", nil). AddOption("item3", nil) grid1.SetRows(4, 2, 0). SetColumns(10, 10, 0, 10). SetBorders(true). AddItem(header, 0, 0, 1, 4, 0, 0, true). AddItem(dropbox, 1, 0, 1, 1, 0, 0, false). AddItem(list1, 2, 0, 1, 1, 0, 0, false). AddItem(textview, 1, 1, 2, 3, 0, 0, false) app.SetRoot(grid1, true).EnableMouse(true).Run() } ```
kerem closed this issue 2026-03-04 01:05:02 +03:00
Author
Owner

@rivo commented on GitHub (May 28, 2021):

Good catch, thanks. I fixed this.

<!-- gh-comment-id:850583941 --> @rivo commented on GitHub (May 28, 2021): Good catch, thanks. I fixed this.
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#439
No description provided.