[GH-ISSUE #786] Form not working in Flex #579

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

Originally created by @Fyb3roptik on GitHub (Dec 21, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/786

Related to https://github.com/rivo/tview/issues/650

flex := tview.NewFlex().
		AddItem(stats, 0, 1, false).
		AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
			AddItem(textView, 0, 1, false).
			AddItem(textView, 0, 1, false).
			AddItem(textView, 0, 1, false), 0, 2, false).
		AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
			AddItem(new_user_form, 0, 2, false), 0, 2, false)

	if err := app.SetRoot(flex, true).EnableMouse(true).Run(); err != nil {
		panic(err)
	}

Mouse is enabled, but I cannot click on the form

Originally created by @Fyb3roptik on GitHub (Dec 21, 2022). Original GitHub issue: https://github.com/rivo/tview/issues/786 Related to https://github.com/rivo/tview/issues/650 ```go flex := tview.NewFlex(). AddItem(stats, 0, 1, false). AddItem(tview.NewFlex().SetDirection(tview.FlexRow). AddItem(textView, 0, 1, false). AddItem(textView, 0, 1, false). AddItem(textView, 0, 1, false), 0, 2, false). AddItem(tview.NewFlex().SetDirection(tview.FlexRow). AddItem(new_user_form, 0, 2, false), 0, 2, false) if err := app.SetRoot(flex, true).EnableMouse(true).Run(); err != nil { panic(err) } ``` Mouse is enabled, but I cannot click on the form
kerem closed this issue 2026-03-04 01:06:11 +03:00
Author
Owner

@Fyb3roptik commented on GitHub (Dec 21, 2022):

// New User Form
	new_user_form := tview.NewForm().
		AddDropDown("Title", []string{"Mr.", "Ms.", "Mrs.", "Dr.", "Prof."}, 0, nil).
		AddInputField("First name", "", 20, nil, nil).
		AddInputField("Last name", "", 20, nil, nil).
		AddCheckbox("Age 18+", false, nil).
		AddPasswordField("Password", "", 10, '*', nil).
		AddButton("Save", nil).
		AddButton("Quit", func() {
			app.Stop()
		})
	new_user_form.SetBorder(true).SetTitle("New User Form").SetTitleAlign(tview.AlignLeft)
<!-- gh-comment-id:1361878022 --> @Fyb3roptik commented on GitHub (Dec 21, 2022): ```go // New User Form new_user_form := tview.NewForm(). AddDropDown("Title", []string{"Mr.", "Ms.", "Mrs.", "Dr.", "Prof."}, 0, nil). AddInputField("First name", "", 20, nil, nil). AddInputField("Last name", "", 20, nil, nil). AddCheckbox("Age 18+", false, nil). AddPasswordField("Password", "", 10, '*', nil). AddButton("Save", nil). AddButton("Quit", func() { app.Stop() }) new_user_form.SetBorder(true).SetTitle("New User Form").SetTitleAlign(tview.AlignLeft) ```
Author
Owner

@Fyb3roptik commented on GitHub (Dec 21, 2022):

I am using zsh if that matters

<!-- gh-comment-id:1361898651 --> @Fyb3roptik commented on GitHub (Dec 21, 2022): I am using zsh if that matters
Author
Owner

@Fyb3roptik commented on GitHub (Dec 21, 2022):

Ok this appears to be an issue with iTerm2. Using normal terminal in macos it works perfectly

<!-- gh-comment-id:1361907644 --> @Fyb3roptik commented on GitHub (Dec 21, 2022): Ok this appears to be an issue with iTerm2. Using normal terminal in macos it works perfectly
Author
Owner

@Fyb3roptik commented on GitHub (Dec 21, 2022):

For those of you looking for this answer, in iTerm2 go to Prefs > Profiles > Terminal and Enable Mouse Reporting. This fixed it for me

<!-- gh-comment-id:1361918225 --> @Fyb3roptik commented on GitHub (Dec 21, 2022): For those of you looking for this answer, in iTerm2 go to Prefs > Profiles > Terminal and Enable Mouse Reporting. This fixed it for me
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#579
No description provided.