Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Dismiss search controller on search execution (#12701)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
  • Loading branch information
kazo0 and jfversluis committed Nov 25, 2021
1 parent 34e82c8 commit be2471c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Collections.ObjectModel;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ManualReview)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 10124, "[Bug] Shell SearchHandler - SearchHandler blocks touch to view", PlatformAffected.iOS)]
public class Issue10124 : TestShell
{
protected override void Init()
{
var cp = CreateContentPage();
cp.Content = new Label
{
Text = "Enter a search query and execute. This content should no longer be obscured by the search controller dimmed background"
};
Shell.SetSearchHandler(cp, new SearchHandler());

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)CollectionViewGroupTypeIssue.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue10124.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue12716.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue12984.xaml.cs">
<DependentUpon>Issue12984.xaml</DependentUpon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ protected virtual void OnSearchHandlerPropertyChanged(object sender, PropertyCha
UpdateSearchVisibility(_searchController);
else if (e.PropertyName == SearchHandler.IsSearchEnabledProperty.PropertyName)
UpdateSearchIsEnabled(_searchController);
else if (e.PropertyName == SearchHandler.IsFocusedProperty.PropertyName)
{
if (!_searchHandler.IsFocused)
_searchController.Active = false;
}
else if (e.Is(SearchHandler.AutomationIdProperty))
{
UpdateAutomationId();
Expand Down

0 comments on commit be2471c

Please sign in to comment.