Skip to content

Commit

Permalink
Focus on text area in input field will trigger input field's focus ca…
Browse files Browse the repository at this point in the history
…llback. #1020
  • Loading branch information
rivo committed Sep 21, 2024
1 parent fd649db commit 520ccd7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inputfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 520ccd7

Please sign in to comment.