Enable Issue33352 UITests#33606
Closed
kubaflo wants to merge 18 commits intodotnet:inflight/candidatefrom
Closed
Conversation
…s misalignment (dotnet#33281) ### Root Cause On Android, for `Label` controls with `LineBreakMode="WordWrap"` and multiple lines, `GetDesiredSize()` returns the full constraint width instead of the actual rendered text width. This causes extra trailing space and incorrect horizontal alignment when `HorizontalLayoutAlignment` is set to `Start`, `Center`, or `End`. Single-line and Fill alignment cases are unaffected. ### Description of Change Updated `GetDesiredSize()` in `LabelHandler.Android.cs` to calculate the actual content width for wrapped, multi-line labels with non-Fill alignment. The implementation determines the widest rendered line using `layout.GetLineWidth(i)` and uses that value (plus padding) as the desired width. ### Issues Fixed Fixes dotnet#31782 Fixes dotnet#27614 Tested the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Output Video | Before Issue Fix | After Issue Fix | |------------------|-----------------| | <img width="350" alt="withoutfix" src="https://github.com/user-attachments/assets/0eca49ce-3cfd-4f42-85cb-98560385a056" /> | <img width="350" alt="withfix" src="https://github.com/user-attachments/assets/a1cba4c6-d422-46ab-96ae-db0dc6dc0dc9" /> |
…t#33369) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause The load-time handling of the `IsEnabled` property for tab items was not implemented on iOS. As a result, disabled tabs could still be selectable and navigateable ### Description of Change Updated `ShellItemRenderer.cs` to set the `IsEnabled` property of each `TabBar` item based on the corresponding `IsEnabled` value during both initial creation and when the items collection changes. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33158 ### Follow-up PR : - On **iOS 26** and **Catalyst 26**, navigation between tabs via drag and selection gestures is handled separately in this PR dotnet#33337. ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/d133ccd3-abb1-44dd-9135-16b1ebeeb8e6"> | <video src="https://github.com/user-attachments/assets/223f454c-fc1a-4167-b265-8ef6c7e0c8c6"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…t#33332) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details When the Picker dialog is closed using the cancel button or tapping outside, the IsOpen property is not updated. Even though the Picker is no longer visible, IsOpen stays true, causing the Picker state to be incorrect. ### Description of Change Updated the Android Picker handler to reset VirtualView.IsOpen to false when the picker dialog is dismissed. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33331 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **Android**<br> <video src="https://github.com/user-attachments/assets/5dc18c5f-a2d2-48cd-95eb-d150b210c4ce" width="300" height="600"> | **Android**<br> <video src="https://github.com/user-attachments/assets/c30f015d-5d2b-46cc-9bc1-d07ba9ed485c" width="300" height="600"> |
<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change This pull request updates the way checkbox tint colors are handled on Android, improving compatibility with both Material 2 and Material 3 themes. The main focus is on ensuring that the correct default or accent color is used for checkbox foregrounds depending on the Material version in use. **Theme-aware checkbox tinting:** * Introduced a static field `_defaultButtonTintList` in `CheckBoxExtensions` to cache the default button tint for Material 3 themes, ensuring consistent appearance and avoiding unnecessary recomputation. * Updated the `GetColorStateList` method to: - Use the default theme's button tint when Material 3 is enabled, falling back to the cached `_defaultButtonTintList` if available. - Continue using the accent color for Material 2 themes, preserving existing behavior. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33338 ### Screenshots Material Design Spec - [CheckBox](https://m3.material.io/components/checkbox/specs) | Material 2 | Material 3 | |----------|----------| | <img src="https://github.com/user-attachments/assets/8bce9689-a698-49af-862f-24e56ec4f3cb"> | <img src="https://github.com/user-attachments/assets/978b27eb-0e67-451c-8a3b-927434d6389a"> | --------- Co-authored-by: Stephane Delcroix <stephane@delcroix.org>
…movePage() (dotnet#32289) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details When a non-visible page is removed from the navigation stack using RemovePage(), its handler is not disconnected. ### Root Cause The RemovePage() method removes the page from the navigation stack but does not explicitly disconnect its handler. ### Description of Change The handler is now properly disconnected when a page is removed using RemovePage(). Regression PR: dotnet#24887 ### Tested the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes dotnet#32239 ### Screenshots **Android:** | Before Issue Fix | After Issue Fix | |----------|----------| | <video width="300" height="600" src="https://github.com/user-attachments/assets/890c3e4b-f520-4826-b942-6ec9e04233d1"> | <video width="300" height="600" src="https://github.com/user-attachments/assets/40ebc025-7298-4b43-8816-4932a01fb563">) | **iOS:** | Before Issue Fix | After Issue Fix | |----------|----------| | <video width="300" height="600" src="https://github.com/user-attachments/assets/484e17cd-bd83-415e-af27-99acf893b203"> | <video width="300" height="600" src="https://github.com/user-attachments/assets/062a1c6d-047c-4bde-add2-d2d261763c87">) | --------- Co-authored-by: Stephane Delcroix <stephane@delcroix.org> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
…ShellContent (dotnet#33228) ### Issue details When switching between ShellContent items, navigation bar colors from the previously displayed page are incorrectly applied to the next page, even when the next page does not define any navigation bar colors. On iOS, background and title colors persist across pages. On Windows, the issue is limited to TitleColor, which remains applied when navigating to an uncolored page. ### Root cause iOS: Navigation bar appearance is applied via SetAppearance in ShellNavBarAppearanceTracker when colors are specified. However, when navigating to a page without defined colors, the appearance is not reset, causing previously applied colors to persist. Windows: The toolbar title foreground is updated only when a brush is provided. When switching to a page without a TitleColor, the previous brush is not cleared, so the title color remains. ### Description of change iOS: Reset the navigation bar appearance to the default native appearance when no colors are specified, ensuring that colors from a previous page are not carried over. Windows: Clear the toolbar title foreground when the brush is null, allowing the title color to revert to the system default instead of retaining the previous color. ### Tested the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes dotnet#33227 ### Screenshots | Before Issue Fix | After Issue Fix | |----------|----------| | <video width="300" height="600" src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73"> | <video width="300" height="600" src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">) | | Before Issue Fix | After Issue Fix | |----------|----------| | <video width="300" height="600" src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9"> | <video width="300" height="600" src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">) |
…reated with full path (dotnet#28238) ### Issue details Calling OpenReadAsync() on a FileResult constructed using the full path constructor throws a NullReferenceException with the message: "Value cannot be null. (Parameter 'windowsRuntimeFile')". This occurs because the internal File property is null when a full path is provided. ### Description of Change The changes fix the Exception in OpenReadAsync() by properly initializing the File property when a FileResult is created with a full path. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#26858 **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **Windows**<br> <img src="https://github.com/user-attachments/assets/d0fd9a0f-7b7a-4c15-a15f-69f978060067" > |**Windows**<br> <img src="https://github.com/user-attachments/assets/0059d3d6-6350-487a-a8be-618cc6221b1e" > | --------- Co-authored-by: Shalini-Ashokan <102292178+Shalini-Ashokan@users.noreply.github.com>
…r Labels (dotnet#31619) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Description: The Shell Flyout is implemented using a `UITableViewController` with a `UITableView`, which iOS accessibility services announce as a "table". ### Description of Change: Entirely hides the UITableView Accessibility and makes the UIContainerCell to become a first responder, The inner UIContainerCell cannot be individually detected — it is treated as a single grouped element. ### Issues Fixed Fixes dotnet#30894 ### Tested the behaviour in the following platforms - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac ### Output Screenshot Before Issue Fix | After Issue Fix | |----------|----------| |<video width="300" height="150" alt="Before Fix" src="https://github.com/user-attachments/assets/1862862a-ffee-4302-a46f-5ac083e39a0b">|<video width="300" height="150" alt="After Fix" src ="https://github.com/user-attachments/assets/be969437-d5ea-4319-ac19-9b60bd0e1a68">|
…ced inside a VerticalStackLayout (dotnet#33134) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - When the RecyclerView height is infinite, the EmptyView also receives an infinite height constraint. During measurement, Int.MAX_VALUE is assigned to represent this infinite height. - However, while converting the RecyclerView’s infinite height to an integer value, a pixel conversion issue occurs. As a result, the EmptyView fails to render correctly and does not appear on the screen. ### Description of Change - When the EmptyView height is infinite, the EmptyView is measured to the exact infinite height when its height is set to Int.MAX_VALUE Validated the behaviour in the following platforms - [x] Android - [x] Windows , - [x] iOS, - [x] MacOS ### Issues Fixed Fixes dotnet#32932 ### Output **Android** |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/e1bc87a9-cb07-4e08-86aa-f64159cdcd15" >| <video src="https://github.com/user-attachments/assets/1b89e70d-b93d-4c1f-9e0d-af9db32dbd7b">| --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
…#32905) - [x] Analyze the issue - understand TODOs in binding compilation logic - [x] Identify files to modify: `CompiledBindingMarkup.cs`, `KnownMarkups.cs`, `Descriptors.cs`, `MauiGResources.resx`, etc. - [x] Build and test baseline (100 tests passing) - [x] Add new diagnostic descriptors for binding-related errors (matching XamlC error codes) - MAUIG2041: BindingIndexerNotClosed (matching XC0041) - MAUIG2042: BindingIndexerEmpty (matching XC0042) - MAUIG2043: BindingIndexerTypeUnsupported (matching XC0043) - MAUIG2045: BindingPropertyNotFound (matching XC0045) - MAUIG2024: BindingWithXDataTypeFromOuterScope warning (matching XC0024) - MAUIG2064: NamescopeDuplicate (matching XC0064) - [x] Replace `return false; // TODO report diagnostic` with actual diagnostic reporting - [x] Replace `throw new Exception` with diagnostic reporting - [x] Update resource strings to match XamlC messages - [x] Add unit tests for the new diagnostics (6 tests) - [x] Update AnalyzerReleases.Unshipped.md - [x] Build and test (147 tests passing) - [x] Run code review and address feedback - [x] Run CodeQL checker (no security issues found) - [x] Revert unrelated formatting changes - [x] Fix alignment in Descriptors.cs - [x] Change diagnostic prefix from MAUIX to MAUIG per reviewer feedback - [x] Remove unreachable code in CompiledBindingMarkup.cs - [x] Add missing test scenarios for MAUIG2024 and MAUIG2043 diagnostics - [x] Support NoWarn metadata for source generator diagnostics - [x] Add MAUIG2045 to NoWarn for test XAML files with intentional binding errors - [x] Address latest code review feedback: - Refactored repeated indexer lookup pattern into reusable local function - Removed localized message checks from diagnostic tests - Fixed IndexerBindings test assertions to properly validate lambda context using regex patterns that match actual generated code structure <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[XSG] Improve diagnostic reporting during binding compilation</issue_title> > <issue_description>We left several todos in the binding compilation logic in the XAML source generator. We should try to match the warnings and errors produced by XamlC, just with an adjusted error code.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes dotnet#32904 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com> Co-authored-by: Simon Rozsival <simon@rozsival.com>
…blePropertyAttribute (dotnet#33028) > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Binding source generators now support properties generated by CommunityToolkit.Mvvm's `[ObservableProperty]` attribute. Previously, bindings failed because MAUI generators cannot see properties generated by other source generators. **Implementation** (following PR dotnet#32954 pattern for RelayCommand): - **BindingSourceGen/ITypeSymbolExtensions.cs**: Added `TryGetObservablePropertyType()` to detect fields with `[ObservableProperty]` and infer property types. Supports all three documented field naming patterns: `camelCase`, `_camelCase`, and `m_camelCase`. Includes validation for empty property names. - **BindingSourceGen/PathParser.cs**: Enhanced `TryHandleSpecialCases()` to handle ObservableProperty patterns as fallback when symbol resolution fails. - **BindingSourceGen/BindingSourceGenerator.cs**: Updated `GetLambdaReturnType()` to infer types from ObservableProperty fields, enabling C# lambda bindings. - **SourceGen/ITypeSymbolExtensions.cs**: Updated `TryGetProperty()` to check ObservableProperty-inferred properties, enabling XAML string-based bindings. - **Tests**: Added comprehensive unit tests in `BindingSourceGen.UnitTests` (8 tests) to validate ObservableProperty binding support across all field naming patterns and scenarios. Tests verify the generated binding code by checking: - Handler patterns: `new(static source => source, "PropertyName")` - validates property path in generated code - Setter expressions: `source.PropertyName = value;` - validates property assignment **Field Naming Pattern Support:** All three CommunityToolkit.Mvvm documented naming conventions are supported: - `name` → `Name` - `_name` → `Name` - `m_name` → `Name` **Works for both XAML and C# bindings:** ```csharp public class MyViewModel { [ObservableProperty] private string? name; // Generates Name property [ObservableProperty] private ObservableCollection<Tag> _tags = new(); // Generates Tags property [ObservableProperty] private int m_count; // Generates Count property } ``` ```xaml <Label Text="{Binding Name}" /> <ListView ItemsSource="{Binding Tags}" /> ``` ```csharp label.SetBinding(Label.TextProperty, static (MyViewModel vm) => vm.Name); listView.SetBinding(ListView.ItemsSourceProperty, static (MyViewModel vm) => vm.Tags); ``` ### Issues Fixed Fixes dotnet#32597 <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[XSG][BindingSourceGen] Add support for CommunityToolkit.Mvvm ObservablePropertyAttribute source generator</issue_title> > <issue_description>Similar to dotnet#32597 > Related to dotnet#32953 > > The CommunityToolkit.Mvvm package contains a source generator which generates bindable property bolierplate code based on the `[ObservableProperty]` attribute: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/observableproperty > > Scenarios: > ```c# > // applied to a field > [ObservableProperty] > private string? name; > > // generated code: > /// <inheritdoc cref="_tags"/> > [global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.3.0.0")] > [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] > public global::System.Collections.ObjectModel.ObservableCollection<global::TestSampleContentBindings.Models.Tag> Tags > { > get => _tags; > [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_tags")] > set > { > if (!global::System.Collections.Generic.EqualityComparer<global::System.Collections.ObjectModel.ObservableCollection<global::TestSampleContentBindings.Models.Tag>>.Default.Equals(_tags, value)) > { > OnTagsChanging(value); > OnTagsChanging(default, value); > OnPropertyChanging(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangingArgs.Tags); > _tags = value; > OnTagsChanged(value); > OnTagsChanged(default, value); > OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.Tags); > } > } > } > ``` > > Our source generators cannot see properties generated by other source generators, so the binding compilation will fail. > > Our sample content template uses this source generator and we are currently failing over to reflection-based bindings.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes dotnet#32955 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com> Co-authored-by: Simon Rozsival <simon@rozsival.com>
…n contentType property (dotnet#33390) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details The FileResult constructor was being called with (filePath, fileName) but the second parameter expects a MIME type, not a filename. This caused the filename to be stored as ContentType. ### Description of Change <!-- Enter description of the fix in this section --> Fixed FileResult initialization to properly preserve the filename and ContentType. ### Regarding Test Case Picking an image is not possible in a test. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33348 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/47360519-a071-47eb-9a79-66069f8711a8" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/47a43e9d-c90f-4c79-ac81-779e50198cff" width="300" height="600"> |
…stroyed activities (dotnet#29780) ## Problem Random crashes occurring on Android devices with the error: ``` java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity at com.bumptech.glide.manager.RequestManagerRetriever.assertNotDestroyed(RequestManagerRetriever.java:236) at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:110) at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:92) at com.bumptech.glide.Glide.with(Glide.java:545) at com.microsoft.maui.glide.MauiCustomTarget.lambda$clear$0$com-microsoft-maui-glide-MauiCustomTarget(MauiCustomTarget.java:88) ``` This happens when Glide attempts to clear image targets using a Context whose underlying Activity has been destroyed. ## Solution Added defensive context destruction check in `MauiCustomTarget.clear()` before calling `Glide.with(context).clear(this)`. **Key Changes:** 1. **Added private context lifecycle validation methods to MauiCustomTarget:** - `isContextDestroyed()` - Checks if context/activity is destroyed or finishing - `getActivity()` - Safely extracts Activity from Context (handles ContextWrapper chains) 2. **Protected MauiCustomTarget.clear() operation:** - Added context check before calling `Glide.with(context).clear(this)` - Includes verbose logging when the clear operation is skipped due to destroyed context **Behavior:** - When context is destroyed, `clear()` returns early without attempting to call Glide - Matches Glide's own validation logic: `activity.isFinishing() || activity.isDestroyed()` - Logs a debug message when clear is skipped (if verbose logging is enabled) **Example of the fix:** ```java private void clear() { post(() -> { if (isContextDestroyed(context)) { if (logger.isVerboseLoggable) { logger.v("clear() skipped - context destroyed: " + resourceLogIdentifier); } return; } Glide .with(context) .clear(this); }); } ``` This is a surgical, minimal fix that targets the specific crash location identified in the stack trace while maintaining all existing functionality. Fixes dotnet#29699. --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more <a href="https://gh.io/copilot-coding-agent-tips">Copilot coding agent tips</a> in the docs. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
…otnet#33406) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause : Navigation fails because `UISearchController` was dismissed before `ItemSelected` was called, triggering a UIKit transition that deactivates the Shell navigation context and prevents the navigation from completing ### Description of Change : Changed the order in `OnSearchItemSelected` in `ShellPageRendererTracker.cs` to call `ItemSelected` before deactivating the search controller for correct event handling. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33356 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/0e63dd86-1965-404a-8d07-6d3afd952498"> | <video src="https://github.com/user-attachments/assets/af867272-434f-411e-9a6f-a68a87cfc3a7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
### Issue Description: VoiceOver does not read the ComboBox State correctly, In the sample, the ComboBox behavior is implemented using SfTextInputLayout with a Picker. However, I have already implemented the semantic properties for picker , it was overriden by SfTextInputLayout, the expectation is for VoiceOver to recognise and announce it as a ComboBox state. ### Description of change : Update SemanticProperties using property changed on IsOpen property in picker to achieve the expected output. > Note: net9.0 PR - dotnet/maui-samples#651 ### Issues Fixed Fixes [dotnet#30899 ](dotnet#30899) ### Tested the behaviour in the following platforms - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Fixes dotnet#33532 When a XAML file contains `NaN` as a value (e.g., `Padding="NaN"`), the XAML Source Generator was generating invalid C# code using bare `NaN` instead of `double.NaN`, resulting in: ``` error CS0103: The name 'NaN' does not exist in the current context ``` ### Root Cause The `FormatInvariant()` helper method in `GeneratorHelpers.cs` uses `SymbolDisplay.FormatPrimitive()` which outputs just `"NaN"` for `double.NaN` values, without the required type prefix. ### Fix Updated `FormatInvariant()` to explicitly check for special floating-point values (`NaN`, `PositiveInfinity`, `NegativeInfinity`) for both `double` and `float` types, and return the properly qualified C# literals (e.g., `double.NaN`, `float.PositiveInfinity`). ## Changes ### Modified - `src/Controls/src/SourceGen/GeneratorHelpers.cs` - Added special handling for NaN and Infinity values ### Added Tests - `src/Controls/tests/SourceGen.UnitTests/Maui33532Tests.cs` - 5 SourceGen unit tests for ThicknessConverter with NaN - `src/Controls/tests/Xaml.UnitTests/Issues/Maui33532.xaml[.cs]` - XAML unit test for all inflators ## Testing All new tests pass: - `ThicknessWithSingleNaNValue` - Tests `Padding="NaN"` - `ThicknessWithTwoNaNValues` - Tests `Padding="NaN,NaN"` - `ThicknessWithFourNaNValues` - Tests `Padding="NaN,NaN,NaN,NaN"` - `ThicknessWithMixedNaNAndRegularValues` - Tests `Padding="NaN,10,NaN,20"` - `MarginWithNaNValue` - Tests `Margin="NaN"`
…ow disposal (dotnet#33353) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Fixes an intermittent `ObjectDisposedException` crash when exiting MacCatalyst/iOS apps. **Root cause:** When a window closes, `Window.Destroying()` disposes the service provider scope, then iOS/MacCatalyst calls `TraitCollectionDidChange` on view controllers. The override in `ShellSectionRootRenderer` tried to access disposed services, causing the crash. **Architectural improvement:** This PR removes duplicate theme handling code: 1. **REMOVED** `TraitCollectionDidChange` override from `ShellSectionRootRenderer` (Controls layer - Shell-specific) 2. **ENHANCED** `TraitCollectionDidChange` in `PageViewController` (Core layer - applies to ALL pages) with: - `window?.Handler == null` check to detect window destruction before accessing services - try-catch safety net for race conditions **Why this approach:** - Core implementation handles theme changes for all pages (not just Shell) - Window.Handler check proactively detects teardown phase (Handler disconnects before service disposal) - try-catch provides safety net for potential race conditions - Eliminates code duplication across layers **Test added:** `Issue33352` test verifies no crash when `TraitCollectionDidChange` called after window disposal. ### Issues Fixed Fixes dotnet#33352 ``` --- ## What Changed from Original | Section | Original | Recommended | Why | |---------|----------|-------------|-----| | **NOTE block** | Missing | Added | Required for user testing | | **Root cause** | Brief mention | Detailed window disposal sequence | Helps future developers understand timing | | **Implementation** | "disabled/removed" | Two-part architectural improvement | Accurately describes both removal AND enhancement | | **PageViewController** | Not mentioned | Detailed enhancement with checks | This is half the fix - must be documented | | **Rationale** | Not provided | "Why this approach" section | Explains architectural decision | | **Test** | Not mentioned | Mentioned with test name | Documents test coverage | --- --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Uncomments the Issue33352 test, making it active again now that supporting changes have been merged.
This was referenced Jan 19, 2026
Open
981bbb3 to
37340a4
Compare
456e69a to
960abd8
Compare
c8ea704 to
4d7dac7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is ready for merge when #33552 is merged