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

Dismiss UISearchController when losing focus #12701

Merged
merged 2 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
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
@@ -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