From fa21fd3ce071e2b76ceb95a2d029968647ea7912 Mon Sep 17 00:00:00 2001 From: SubhikshaSf4851 Date: Thu, 4 Dec 2025 14:12:54 +0530 Subject: [PATCH 1/4] [Windows] Fixed picker resize on window changes --- src/Core/src/Handlers/Picker/PickerHandler.Windows.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs b/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs index 7275ebf2c20a..f4550f9d6ec7 100644 --- a/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs +++ b/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs @@ -145,6 +145,12 @@ void OnMauiComboBoxDropDownClosed(object? sender, object e) if (VirtualView is null) return; + if (sender is ComboBox comboBox) + { + //Reset the MinWidth to allow ComboBox to resize with window changes + comboBox.MinWidth = 0; + } + VirtualView.IsOpen = false; } } From 2f2f0b70820242eebe2363679237ddd3c6174f9d Mon Sep 17 00:00:00 2001 From: SubhikshaSf4851 Date: Thu, 4 Dec 2025 17:32:30 +0530 Subject: [PATCH 2/4] Updated condition --- src/Core/src/Handlers/Picker/PickerHandler.Windows.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs b/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs index f4550f9d6ec7..ede369bf75aa 100644 --- a/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs +++ b/src/Core/src/Handlers/Picker/PickerHandler.Windows.cs @@ -145,9 +145,9 @@ void OnMauiComboBoxDropDownClosed(object? sender, object e) if (VirtualView is null) return; - if (sender is ComboBox comboBox) + if (sender is ComboBox comboBox && comboBox.MinWidth > 0) { - //Reset the MinWidth to allow ComboBox to resize with window changes + //Reset the MinWidth to allow ComboBox to resize when the parent's size changes comboBox.MinWidth = 0; } From 1e4fe791d76c15feb0a7792e6a6d545a8a94c3ac Mon Sep 17 00:00:00 2001 From: SubhikshaSf4851 Date: Thu, 4 Dec 2025 20:03:38 +0530 Subject: [PATCH 3/4] Updated TestSample --- .../TestCases.HostApp/Issues/Issue32984.cs | 35 +++++++++++++++++++ .../Tests/Issues/Issue32984.cs | 27 ++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32984.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32984.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue32984.cs new file mode 100644 index 000000000000..f9e9e1f91b9e --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32984.cs @@ -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 { "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; + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs new file mode 100644 index 000000000000..4b8e99a20d09 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs @@ -0,0 +1,27 @@ +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"); + App.TapCoordinates(10, 10); + App.Tap("issue32984Button"); + App.Tap("issue32984Picker"); + VerifyScreenshot(); + } +} \ No newline at end of file From 2c492c875db6aab81d02f4db50d1016f39165264 Mon Sep 17 00:00:00 2001 From: Subhiksha Chandrasekaran Date: Thu, 4 Dec 2025 20:26:07 +0530 Subject: [PATCH 4/4] Modified TestSample --- .../TestCases.Shared.Tests/Tests/Issues/Issue32984.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs index 4b8e99a20d09..7e5e6aa69af1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32984.cs @@ -19,7 +19,15 @@ public void Issue32984PickerShouldResize() { App.WaitForElement("issue32984Button"); App.Tap("issue32984Picker"); - App.TapCoordinates(10, 10); +#if ANDROID + App.WaitForElement("Cancel"); + App.Tap("Cancel"); +#elif IOS || MACCATALYST + App.WaitForElement("Done"); + App.Tap("Done"); +#elif WINDOWS + App.TapCoordinates(10, 10); +#endif App.Tap("issue32984Button"); App.Tap("issue32984Picker"); VerifyScreenshot();