Skip to content
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
Expand Up @@ -177,7 +177,10 @@ void UpdateSearchBarBackgroundColor(UITextField textField)
backgroundView.ClipsToBounds = true;
if (_defaultBackgroundColor == null)
_defaultBackgroundColor = backgroundView.BackgroundColor;
backgroundView.BackgroundColor = backGroundColor.ToPlatform();

UIColor backgroundColor = backGroundColor.ToPlatform();
backgroundView.BackgroundColor = backgroundColor;
textField.BackgroundColor = backgroundColor;
}

void UpdateCancelButtonColor(UIButton cancelButton)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23325.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="Maui.Controls.Sample.Issues"
x:Class="Maui.Controls.Sample.Issues.Issue23325">
<ShellContent>
<ContentPage Title="Main page">
<Shell.SearchHandler>
<SearchHandler Placeholder="Search..."
SearchBoxVisibility="Expanded"
BackgroundColor="Red"/>
</Shell.SearchHandler>
<Label Text="Hello, Maui!" AutomationId="label"/>
</ContentPage>
</ShellContent>
</Shell>
17 changes: 17 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23325.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using Microsoft.Maui.Platform;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 23325, "Setting background color on the Searchbar does nothing", PlatformAffected.All)]
public partial class Issue23325 : Shell
{
public Issue23325()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#if IOS || Android
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue23325 : _IssuesUITest
{
public Issue23325(TestDevice device) : base(device)
{
}

public override string Issue => "Setting background color on the Searchbar does nothing";

[Test]
[Category(UITestCategories.SearchBar)]
public void Issue23325Test()
{
App.WaitForElement("label");

// The test passes if search handler is red
VerifyScreenshot();
}
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.