Skip to content
Open
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
TextTransform="{Binding TextTransform}"
VerticalTextAlignment="{Binding VerticalTextAlignment}"/>
</Shell.SearchHandler>
<ScrollView>
<VerticalStackLayout Padding="10,8">
<VerticalStackLayout x:Name="MainStack"
Padding="10,8">

<!-- Action buttons -->
<Grid RowSpacing="2"
Expand Down Expand Up @@ -159,11 +159,10 @@
AutomationId="SelectedItem"
Text="{Binding SelectedItem}"/>
</Grid>
<!-- Spacer to ensure content is scrollable for Collapsible search box -->
<!-- Spacer to ensure content is scrollable for Collapsible search box on iOS/MacCatalyst -->
<BoxView HeightRequest="600"
Color="Transparent"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
</ShellContent>
</Shell>
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ public ShellSearchControlPage()
SearchHandlerInstance.SetViewModel(_viewModel);
SearchHandlerInstance.Focused += OnSearchHandlerFocused;
SearchHandlerInstance.Unfocused += OnSearchHandlerUnfocused;

// SearchBoxVisibility=Collapsible requires a scrollable content view to hide/reveal
// the search bar via scroll gesture on iOS/MacCatalyst. On Windows a ScrollView here isn't needed and causes a persistent scrollbar to render in CI
// so only wrap the content in a ScrollView for the platforms that require it.
if (DeviceInfo.Platform == DevicePlatform.iOS || DeviceInfo.Platform == DevicePlatform.MacCatalyst)
{
SearchContentPage.Content = new ScrollView { Content = MainStack };
}
}

void OnSearchHandlerFocused(object sender, EventArgs e)
Expand Down
49 changes: 24 additions & 25 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue36749.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public Issue36749()
Text = "Test Button",
AutomationId = "Issue36749Button"
};
_button.Loaded += OnButtonLoaded;

Content = new VerticalStackLayout
{
Expand All @@ -44,28 +45,26 @@ public Issue36749()
};
}

protected override void OnAppearing()
void OnButtonLoaded(object sender, EventArgs e)
{
base.OnAppearing();

#if IOS || MACCATALYST
if (_button.Handler?.PlatformView is UIButton platformButton)
{
// The native UIButton subclass sets BackgroundColor = UIColor.Cyan in its constructor.
// With the regression: initial null-Background mapping resets it to UIColor.Clear.
// With the fix: the Window-null check skips the reset, preserving Cyan.
platformButton.BackgroundColor.GetRGBA(out var r, out var g, out var b, out var a);
if (_button.Handler?.PlatformView is UIButton platformButton)
{
// The native UIButton subclass sets BackgroundColor = UIColor.Cyan in its constructor.
// With the regression: initial null-Background mapping resets it to UIColor.Clear.
// With the fix: the Window-null check skips the reset, preserving Cyan.
platformButton.BackgroundColor.GetRGBA(out var r, out var g, out var b, out var a);

// UIColor.Cyan = R:0, G:1, B:1, A:1
bool isCyan = r < 0.01 && g > 0.99 && b > 0.99 && a > 0.99;
_resultLabel.Text = isCyan ? "PASS" : "FAIL";
}
else
{
// Handler or platform view unavailable — mark as FAIL so the test fails
// immediately rather than timing out on "Checking...".
_resultLabel.Text = "FAIL";
}
// UIColor.Cyan = R:0, G:1, B:1, A:1
bool isCyan = r < 0.01 && g > 0.99 && b > 0.99 && a > 0.99;
_resultLabel.Text = isCyan ? "PASS" : "FAIL";
}
else
{
// Handler or platform view unavailable — mark as FAIL so the test fails
// immediately rather than timing out on "Checking...".
_resultLabel.Text = "FAIL";
}
#endif
}
}
Expand All @@ -79,16 +78,16 @@ public class Issue36749Button : Button { }
// The cross-platform Button intentionally leaves Background and TextColor unset.
class Issue36749NativeStyledButton : UIButton
{
public Issue36749NativeStyledButton() : base(UIButtonType.System)
{
BackgroundColor = UIColor.Cyan;
SetTitleColor(UIColor.DarkGray, UIControlState.Normal);
}
public Issue36749NativeStyledButton() : base(UIButtonType.System)
{
BackgroundColor = UIColor.Cyan;
SetTitleColor(UIColor.DarkGray, UIControlState.Normal);
}
}

class Issue36749ButtonHandler : ButtonHandler
{
protected override UIButton CreatePlatformView() => new Issue36749NativeStyledButton();
protected override UIButton CreatePlatformView() => new Issue36749NativeStyledButton();
}

#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,8 @@ public SafeArea_BorderFeatureTests(TestDevice device)
private int GetKeyboardY()
{
#if IOS
if (App is AppiumIOSApp iosApp && HelperExtensions.IsIOS26OrHigher(iosApp))
{
var rect = App.WaitForElement("Toolbar").GetRect();
return rect.Y;
}
else
{
var rect = App.WaitForElement("Done").GetRect();
return rect.Y;
}
var rect = App.WaitForElement("DoneAccessory").GetRect();
return rect.Y;
#elif ANDROID
var (_, screenHeight) = GetScreenSize();
var insets = GetSafeAreaInsets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,8 @@ public SafeArea_ContentViewFeatureTests(TestDevice device)
private int GetKeyboardY()
{
#if IOS
if (App is AppiumIOSApp iosApp && HelperExtensions.IsIOS26OrHigher(iosApp))
{
var rect = App.WaitForElement("Toolbar").GetRect();
return rect.Y;
}
else
{
var rect = App.WaitForElement("Done").GetRect();
return rect.Y;
}
var rect = App.WaitForElement("DoneAccessory").GetRect();
return rect.Y;
#elif ANDROID
// Calculate keyboard top Y position
var (_, screenHeight) = GetScreenSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,8 @@ public SafeArea_GridFeatureTests(TestDevice device)
private int GetKeyboardY()
{
#if IOS
if (App is AppiumIOSApp iosApp && HelperExtensions.IsIOS26OrHigher(iosApp))
{
var rect = App.WaitForElement("Toolbar").GetRect();
return rect.Y;
}
else
{
var rect = App.WaitForElement("Done").GetRect();
return rect.Y;
}
var rect = App.WaitForElement("DoneAccessory").GetRect();
return rect.Y;
#elif ANDROID
var (_, screenHeight) = GetScreenSize();
var insets = GetSafeAreaInsets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,7 @@ public void VerifyShellSearch_TextTransformLowercase()
public void VerifyShellSearch_TextColor()
{
#if IOS
App.WaitForElement("Cancel");
App.Tap("Cancel");
App.PressEnter();
#elif MACCATALYST
App.WaitForElement("Options");
App.Tap("Options");
Expand All @@ -620,8 +619,7 @@ public void VerifyShellSearch_CancelButtonColor()
{
// TODO: For now, CI shows an incorrect screenshot for this test; it renders properly on local macOS 26.
#if IOS
App.WaitForElement("Cancel");
App.Tap("Cancel");
App.PressEnter();
#elif MACCATALYST
App.WaitForElement("Options");
App.Tap("Options");
Expand All @@ -644,8 +642,7 @@ public void VerifyShellSearch_CancelButtonColor()
public void VerifyShellSearch_CharacterSpacing()
{
#if IOS
App.WaitForElement("Cancel");
App.Tap("Cancel");
App.PressEnter();
#elif MACCATALYST
App.WaitForElement("Options");
App.Tap("Options");
Expand All @@ -669,8 +666,7 @@ public void VerifyShellSearch_CharacterSpacing()
public void VerifyShellSearch_TextTransformUppercase()
{
#if IOS
App.WaitForElement("Cancel");
App.Tap("Cancel");
App.PressEnter();
#elif MACCATALYST
App.WaitForElement("Options");
App.Tap("Options");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public void VerifyFlyoutWithHeaderFooter()
App.Tap("ToggleHeaderFooter");
App.WaitForElement("PageLoaded");
App.ShowFlyout();
App.WaitForElement("Header View");
App.WaitForElement("Footer View");
App.WaitForElement("Header");
App.WaitForElement("Footer");
VerifyScreenshot();
}

Expand All @@ -61,8 +61,8 @@ public void VerifyCustomFlyoutContentTemplateWithHeaderFooter()
App.Tap("ToggleHeaderFooter");
App.WaitForElement("PageLoaded");
App.ShowFlyout();
App.WaitForElement("Header View");
App.WaitForElement("Footer View");
App.WaitForElement("Header");
App.WaitForElement("Footer");
VerifyScreenshot();
}

Expand Down Expand Up @@ -91,8 +91,8 @@ public void VerifyCustomFlyoutContentWithHeaderFooter()
App.WaitForElement("PageLoaded");
App.ShowFlyout();
App.WaitForElement("ContentView");
App.WaitForElement("Header View");
App.WaitForElement("Footer View");
App.WaitForElement("Header");
App.WaitForElement("Footer");
VerifyScreenshot();
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading