Problem Icon inside FluentTextField #2016
meliora-solution
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
You should probably have a different problem, because I used your example (see below) and the password doesn't become `null'. <FluentStack Orientation="Orientation.Vertical">
<FluentTextField Name="Input.UserName" @bind-Value="UserName" AutoComplete="username" Required="true" Placeholder="[email protected]" Label="Email" Style="width: 100%" />
<FluentTextField @bind-Value="@Password" Required="true"
Placeholder="enter your password" Style="width: 100%" TextFieldType="@textPassword">
<FluentIcon Slot="end" Icon="Icons.Regular.Size20.Eye" Color="Color.Accent" @onclick="() => ShowPassword()" />
</FluentTextField>
</FluentStack>
@code
{
string UserName;
string Password;
TextFieldType textPassword;
private void ShowPassword()
{
textPassword = textPassword == TextFieldType.Password ? TextFieldType.Text : TextFieldType.Password;
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an icon inside FluentTextField to show/hide password. I entered userName and password but when I clicked it, the password becomes null. It turns out that icon inside FluentTextField caused the password = null.
To make it work, I put that icon outside of the FluentTextField.
This is not as good as the first choice (icon inside FluentTextField) but it works. Is there any way to make it work with icon and event ShowPassword inside the textField ?
Beta Was this translation helpful? Give feedback.
All reactions