Skip to content

Commit

Permalink
Fix password placeholder font issue (#12943)
Browse files Browse the repository at this point in the history
Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
  • Loading branch information
github-actions[bot] and rachelkang authored Jan 27, 2023
1 parent cae73b1 commit 8bbdfc9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Core/src/Platform/Android/EditTextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,25 +298,21 @@ internal static void SetInputType(this EditText editText, ITextInput textInput)
editText.KeyListener = LocalizedDigitsKeyListener.Create(editText.InputType);
}

bool hasPassword = false;

if (textInput is IEntry entry && entry.IsPassword)
{
if ((nativeInputTypeToUpdate & InputTypes.ClassText) == InputTypes.ClassText)
nativeInputTypeToUpdate |= InputTypes.TextVariationPassword;

if ((nativeInputTypeToUpdate & InputTypes.ClassNumber) == InputTypes.ClassNumber)
nativeInputTypeToUpdate |= InputTypes.NumberVariationPassword;

hasPassword = true;
}

editText.InputType = nativeInputTypeToUpdate;

if (textInput is IEditor)
editText.InputType |= InputTypes.TextFlagMultiLine;

if (hasPassword && textInput is IElement element)
if (textInput is IElement element)
{
var services = element.Handler?.MauiContext?.Services;

Expand Down

0 comments on commit 8bbdfc9

Please sign in to comment.