From 520ccd71f0785637427f78f42e3333eb253bfa7f Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:12:17 +0200 Subject: [PATCH] Focus on text area in input field will trigger input field's focus callback. #1020 --- inputfield.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inputfield.go b/inputfield.go index 27b74bce..05411300 100644 --- a/inputfield.go +++ b/inputfield.go @@ -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)