rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang
MIT License
11.14k stars 575 forks source link

Fix maximum-field-width / background-color for InputField #924

Open moson-mo opened 12 months ago

moson-mo commented 12 months ago

Before: image

Demo code:

package main

import (
    "github.com/gdamore/tcell/v2"
    "github.com/rivo/tview"
)

func main() {
    app := tview.NewApplication()
    form := tview.NewForm()
    form.AddInputField("test color", "test", 15, nil, nil).
        AddInputField("test width", "test", 1000, nil, nil).
        SetBackgroundColor(tcell.ColorDarkBlue).
        SetBorder(true)
    if err := app.SetRoot(form, true).EnableMouse(true).Run(); err != nil {
        panic(err)
    }
}

After:

image