From 4ff5817c67b6dcaa91e3966e5d4c20ebf2b78513 Mon Sep 17 00:00:00 2001
From: mckaragoz <78308169+mckaragoz@users.noreply.github.com>
Date: Wed, 19 Apr 2023 13:52:03 +0300
Subject: [PATCH] PasswordField Fix AdornmentIcon Not Showing
---
.../PasswordField/MudPasswordField.razor | 81 ++++++++++---------
.../PasswordField/MudPasswordField.razor.cs | 5 ++
.../Examples/PasswordFieldExample1.razor | 11 ++-
3 files changed, 57 insertions(+), 40 deletions(-)
diff --git a/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor b/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor
index 85b6d56c..7b2555a7 100644
--- a/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor
+++ b/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor
@@ -19,43 +19,50 @@
ForId="@FieldId">
-
+
+
+ @if (CustomAdornment != null)
+ {
+ @CustomAdornment
+ }
+ else
+ {
+
+ }
+
+
+
diff --git a/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor.cs b/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor.cs
index 385bc87e..20cf2355 100644
--- a/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor.cs
+++ b/CodeBeam.MudBlazor.Extensions/Components/PasswordField/MudPasswordField.razor.cs
@@ -44,6 +44,11 @@ public partial class MudPasswordField : MudDebouncedInput
///
[Parameter] public EventCallback OnClearButtonClick { get; set; }
+ ///
+ /// RenderFragment for end adornment.
+ ///
+ [Parameter] public RenderFragment CustomAdornment { get; set; }
+
public override ValueTask FocusAsync()
{
return InputReference.FocusAsync();
diff --git a/ComponentViewer.Docs/Pages/Examples/PasswordFieldExample1.razor b/ComponentViewer.Docs/Pages/Examples/PasswordFieldExample1.razor
index 45b5fe86..59bdd852 100644
--- a/ComponentViewer.Docs/Pages/Examples/PasswordFieldExample1.razor
+++ b/ComponentViewer.Docs/Pages/Examples/PasswordFieldExample1.razor
@@ -1,11 +1,16 @@
-
-
- Password Mode
+
+
+
+
+
+ Password Mode
+
@code{
string _password = "asdf";
bool _passwordMode;
+ Size _size = Size.Medium;
}