Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions src/Core/src/Platform/iOS/MauiSearchBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public MauiSearchBar() : this(RectangleF.Empty)

public MauiSearchBar(NSCoder coder) : base(coder)
{
InsetsLayoutMarginsFromSafeArea = false;
}

public MauiSearchBar(CGRect frame) : base(frame)
{
InsetsLayoutMarginsFromSafeArea = false;
}

protected MauiSearchBar(NSObjectFlag t) : base(t)
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#nullable enable
override Microsoft.Maui.Handlers.StepperHandler.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
override Microsoft.Maui.Platform.MauiView.DidUpdateFocus(UIKit.UIFocusUpdateContext! context, UIKit.UIFocusAnimationCoordinator! coordinator) -> void
override Microsoft.Maui.Platform.MauiView.DidUpdateFocus(UIKit.UIFocusUpdateContext! context, UIKit.UIFocusAnimationCoordinator! coordinator) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
using ObjCRuntime;
using UIKit;
using Xunit;
Expand Down Expand Up @@ -59,6 +60,19 @@ public async Task ReturnTypeInitializesCorrectly()
Assert.Equal(expectedValue, values.PlatformViewValue);
}

[Fact(DisplayName = "MauiSearchBar disables InsetsLayoutMarginsFromSafeArea to prevent double safe-area inset (#34551)")]
public async Task MauiSearchBarInsetsLayoutMarginsFromSafeAreaIsFalse()
{
var searchBar = new SearchBarStub();

await InvokeOnMainThreadAsync(() =>
{
var platformView = CreateHandler(searchBar).PlatformView;
var mauiSearchBar = Assert.IsType<MauiSearchBar>(platformView);
Assert.False(mauiSearchBar.InsetsLayoutMarginsFromSafeArea);
});
Comment thread
SubhikshaSf4851 marked this conversation as resolved.
}

[Fact]
public async Task ShouldShowCancelButtonToggles()
{
Expand Down
Loading