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.
35 changes: 35 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32984.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, "32984", "Picker on resize not working on Windows", PlatformAffected.UWP)]
public class Issue32984 : ContentPage
{
public Issue32984()
{
VerticalStackLayout layout = new VerticalStackLayout
{
WidthRequest = 600
};

Picker issue32984Picker = new Picker
{
AutomationId = "issue32984Picker",
Title = "Select an item",
HorizontalOptions = LayoutOptions.Fill,
ItemsSource = new List<string> { "Item1", "Item2", "Item3" }
};

Button button = new Button
{
AutomationId = "issue32984Button",
Text = "Click me",
HorizontalOptions = LayoutOptions.Fill
};

button.Clicked += (s, e) => { layout.WidthRequest = 200; };

layout.Children.Add(issue32984Picker);
layout.Children.Add(button);

Content = layout;
}
}
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,35 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

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

public override string Issue => "Picker on resize not working on Windows";

[Test]
[Category(UITestCategories.Picker)]
public void Issue32984PickerShouldResize()
{
App.WaitForElement("issue32984Button");
App.Tap("issue32984Picker");
#if ANDROID
App.WaitForElement("Cancel");
App.Tap("Cancel");
#elif IOS || MACCATALYST
App.WaitForElement("Done");
App.Tap("Done");
#elif WINDOWS
App.TapCoordinates(10, 10);
#endif
Comment thread
SubhikshaSf4851 marked this conversation as resolved.
App.Tap("issue32984Button");
App.Tap("issue32984Picker");
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.
6 changes: 6 additions & 0 deletions src/Core/src/Handlers/Picker/PickerHandler.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ void OnMauiComboBoxDropDownClosed(object? sender, object e)
if (VirtualView is null)
return;

if (sender is ComboBox comboBox && comboBox.MinWidth > 0)
{
//Reset the MinWidth to allow ComboBox to resize when the parent's size changes
comboBox.MinWidth = 0;
}

VirtualView.IsOpen = false;
}
}
Expand Down
Loading