Skip to content

Commit

Permalink
chore: Remove Android and iOS AutoSuggestBox checks
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev committed Aug 11, 2024
1 parent 42f3996 commit 5d7e417
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Uno.Gallery/Views/SamplePages/AutoSuggestBoxSamplePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Linq;
using Uno.Gallery.ViewModels;
using Microsoft.UI.Xaml.Controls;
using Uno.Gallery.Helpers;
using Microsoft.UI.Xaml.Media;

namespace Uno.Gallery.Views.Samples
{
Expand All @@ -16,13 +18,10 @@ public AutoSuggestBoxSamplePage()

private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
//This check can be removed when https://github.com/unoplatform/uno/issues/11635 is fixed
#if !__ANDROID__ && !__IOS__
if (args.Reason != AutoSuggestionBoxTextChangeReason.UserInput)
{
return;
}
#endif

if (string.IsNullOrEmpty(sender.Text))
{
Expand All @@ -31,6 +30,7 @@ private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTex

if (((Sample)DataContext).Data is AutoSuggestBoxSamplePageViewModel viewModel)
{
EnsureFluentResourcesForPopups(sender);
sender.ItemsSource = viewModel.GetSuggestedItems(sender.Text).Select(sample => sample.Title).ToList();
}
}
Expand All @@ -46,16 +46,14 @@ private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestB

private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
//This check can be removed when https://github.com/unoplatform/uno/issues/11635 is fixed
#if !__ANDROID__ && !__IOS__
if (args.Reason != AutoSuggestionBoxTextChangeReason.UserInput)
{
return;
}
#endif

if (((Sample)DataContext).Data is AutoSuggestBoxSamplePageViewModel viewModel)
{
EnsureFluentResourcesForPopups(sender);
sender.ItemsSource = viewModel.GetSuggestedItems(sender.Text);
}
}
Expand Down

0 comments on commit 5d7e417

Please sign in to comment.