PlutoUI.jl
PlutoUI.jl copied to clipboard
[Suggestion] Support hide/show toggle on password element
As seen in there:

Example taken from: https://lastpass.com/?ac=1&lpnorefresh=1
Can you elaborate a bit further? What is the proposed API? What is the use case? Do you need notebooks with Username/password inputs? Why is not enough?
itmshowpw = @bind showpw CheckBox()
##next cell
if showpw
itmserverpassword = @bind serverpassword TextField(default=elem.password)
else
itmserverpassword = @bind serverpassword PasswordField(default=elem.password)
end
##next cell
elem.password = serverpassword
Currently I need to use three cells in order to implement the same functionality on whether the password field shows plaintext or hidden text. But that could be moved into the javascript side of the UI-element. The API would just get another two keyword arguments
visibilitytoggledefaulting to true which enables using the toggle andplaintextwhich defaults to false and is the initial state of the toggle