Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Android SearchBar keyboard issue relating to TextTransform #11981

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Android.Widget;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Internals;
using SearchView = AndroidX.AppCompat.Widget.SearchView;

namespace Microsoft.Maui.Controls.Platform
Expand All @@ -8,7 +7,11 @@ public static class SearchViewExtensions
{
public static void UpdateText(this SearchView searchView, InputView inputView)
{
searchView.SetQuery(TextTransformUtilites.GetTransformedText(inputView.Text, inputView.TextTransform), false);
var oldQuery = searchView.Query ?? string.Empty;
var newQuery = TextTransformUtilites.GetTransformedText(inputView.Text, inputView.TextTransform);

if (oldQuery != newQuery)
searchView.SetQuery(newQuery, false);
}
}
}
}