From 8806adf9337d7cf3aea933909f8f40bf27136c03 Mon Sep 17 00:00:00 2001 From: Celian GARCIA Date: Wed, 31 Jan 2024 15:00:04 +0100 Subject: [PATCH] feat: Add a way to completely hide password from Input --- field_input.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/field_input.go b/field_input.go index 5e3e868d..e0d94654 100644 --- a/field_input.go +++ b/field_input.go @@ -109,6 +109,17 @@ func (i *Input) Password(password bool) *Input { return i } +// ExtraHiddenPassword sets whether or not to hide the input while the user is typing. +// Like Password but in this case without displaying mark on each character. +func (i *Input) ExtraHiddenPassword(password bool) *Input { + if password { + i.textinput.EchoMode = textinput.EchoNone + } else { + i.textinput.EchoMode = textinput.EchoNormal + } + return i +} + // Placeholder sets the placeholder of the text input. func (i *Input) Placeholder(str string) *Input { i.textinput.Placeholder = str