Open WeBtOrY-ES opened 1 year ago
@WeBtOrY-ES
This isnt really expected behavior. but this is because of the way that the Form
handles it's internal widgets/fields for focusing things... It obviously shouldn't cause a deadlock/freeze... but this is probably similar to this issue
Basically if you choose to use the Form
widget/primitive, you have to use all the methods within the Form
to add/manage the internal fields/widgets.
Otherwise you can manually handle the container that has your form fields/widgets and not worry about a form container. All the Form
provides is some sugar to make dealing with input containers easier for people who don't want to handle things themselves or have more control.
Hi!
After injecting application and form as a parameters of a function
tview.NewApplication(),tview.NewForm()
asapplication *tview.Application, form *tview.Form
when you use this configuration of AddTextView
form.AddTextView("Server name", serverName, 20, 1, false, false)
and the Esc key is pressed
(captured with this code)
application.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { k := event.Key() if k == tcell.KeyEsc { escPressed = true application.Stop() } return event })
the application freezes.
However, with this configuration of AddTextView is used
form.AddTextView("Server name", serverName, 20, 1, false, true)
the application behaves as it should.
I don't know if is a expected behavior or is a bug.