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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue30463.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 30463, "Picker title is not displayed again", PlatformAffected.iOS)]
public class Issue30463 : ContentPage
{
public Issue30463()
{
VerticalStackLayout stackLayout = new VerticalStackLayout
{
Padding = 20,
Spacing = 10
};

Picker picker = new Picker
{
AutomationId = "RegainingPickerTitle",
Title = "Select an item",
ItemsSource = new List<string> { "Item 1", "Item 2", "Item 3" },
SelectedIndex = 1
};

Button button = new Button
{
AutomationId = "ToggleSelectedIndexBtn",
Text = "Click to change selected index to -1"
};
button.Clicked += (sender, e) =>
{
picker.SelectedIndex = -1;
};

stackLayout.Children.Add(picker);
stackLayout.Children.Add(button);
Content = stackLayout;
}
}

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
@@ -0,0 +1,21 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue30463 : _IssuesUITest
{
public Issue30463(TestDevice device) : base(device) { }

public override string Issue => "Picker title is not displayed again";

[Test]
[Category(UITestCategories.Picker)]
public void PickerShouldRegainTitle()
{
App.WaitForElement("ToggleSelectedIndexBtn");
App.Tap("ToggleSelectedIndexBtn");
VerifyScreenshot();
}
}
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.
1 change: 1 addition & 0 deletions src/Core/src/Platform/iOS/PickerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ internal static void UpdatePicker(this MauiPicker platformPicker, IPicker picker
}
else
{
platformPicker.Text = null;
platformPicker.UpdatePickerTitle(picker);
}

Expand Down
Loading