2
0
mirror of https://github.com/rivo/tview.git synced 2024-11-11 01:10:41 +00:00

Focus on text area in input field will trigger input field's focus callback. #1020

This commit is contained in:
Oliver 2024-09-21 13:12:17 +02:00
parent fd649dbf12
commit 520ccd71f0

View File

@ -135,6 +135,11 @@ func NewInputField() *InputField {
if i.changed != nil {
i.changed(i.textArea.GetText())
}
}).SetFocusFunc(func() {
// Forward focus event to the input field.
if i.Box.focus != nil {
i.Box.focus()
}
})
i.textArea.textStyle = tcell.StyleDefault.Background(Styles.ContrastBackgroundColor).Foreground(Styles.PrimaryTextColor)
i.textArea.placeholderStyle = tcell.StyleDefault.Background(Styles.ContrastBackgroundColor).Foreground(Styles.ContrastSecondaryTextColor)