From e22d32e78b7c824a602df9f6592d4bf5dc4d37e7 Mon Sep 17 00:00:00 2001 From: Choza-rajan Date: Sat, 2 Nov 2024 10:05:45 +0530 Subject: [PATCH] Resolved Null Crash and Improved Hint Behavior in SfTextInputLayout --- maui/src/TextInputLayout/SfTextInputLayout.Methods.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maui/src/TextInputLayout/SfTextInputLayout.Methods.cs b/maui/src/TextInputLayout/SfTextInputLayout.Methods.cs index 0bf4feb6..02087598 100644 --- a/maui/src/TextInputLayout/SfTextInputLayout.Methods.cs +++ b/maui/src/TextInputLayout/SfTextInputLayout.Methods.cs @@ -160,6 +160,7 @@ internal void OnTextInputViewTextChanged(object? sender, TextChangedEventArgs e) { if (!IsHintAlwaysFloated) { + IsHintFloated = false; IsHintDownToUp = true; InvalidateDrawable(); } @@ -173,7 +174,7 @@ internal void OnTextInputViewTextChanged(object? sender, TextChangedEventArgs e) // Clear icon can't draw when isClearIconVisible property updated based on text. // So here call the InvalidateDrawable to draw the clear icon. - if (Text.Length == 1 || Text.Length == 0) + if (Text?.Length <= 1) { InvalidateDrawable(); }