Set character limits on text input examples

This commit is contained in:
Christian Rocha 2020-10-21 10:19:34 -04:00
parent b8bc66ed6f
commit 9e9e05774c
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
2 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,7 @@ func initialModel() model {
inputModel := input.NewModel()
inputModel.Placeholder = "Pikachu"
inputModel.Focus()
inputModel.CharLimit = 20
return model{
textInput: inputModel,

View File

@ -43,14 +43,17 @@ func initialModel() model {
name.Focus()
name.Prompt = focusedPrompt
name.TextColor = focusedTextColor
name.CharLimit = 32
nickName := input.NewModel()
nickName.Placeholder = "Nickname"
nickName.Prompt = blurredPrompt
nickName.CharLimit = 32
email := input.NewModel()
email.Placeholder = "Email"
email.Prompt = blurredPrompt
email.CharLimit = 64
return model{0, name, nickName, email, blurredSubmitButton}