Skip to content

Commit 561aa8a

Browse files
[iOS/macCatalyst] [Candidate Fix] Editor shadow and theme regression caused by BackgroundColor reset on initial handler connection (#35343)
<!-- 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. !!!!!!! --> ### Root Cause of the Regression PR #34741's MapBackground overrides call platformView.BackgroundColor = null during initial handler connection (when Background is null by default), making Editor controls transparent at startup — breaking shadow rendering and app-theme color bindings. ### Description of Change In EditorHandler.iOS.cs, replaced platformView.BackgroundColor = null with platformView.BackgroundColor = ColorExtensions.BackgroundColor (UIColor.SystemBackground) so the Editor restores the system's adaptive default color instead of becoming transparent. This preserves shadow rendering on initial load and correctly responds to light/dark theme changes. ### Issues Fixed UI Test iOS: VerifyEditorPlaceholderWithShadow, VerifyEditor_WithShadow, ShadowsDontRespectControlShape Mac: VerifyEditorPlaceholderWithShadow, VerifyEditor_WithShadow, ShadowsDontRespectControlShape, EditorAndEntryInputFieldsShouldChangeColorsOnAppThemeChange, EntryAndEditorPlaceholderTextColorAppThemeBindingUpdatesOnThemeChange, EntryAndEditorTextColorAppThemeBindingUpdatesOnThemeChange - Fails due to this PR - #34741
1 parent f1a5769 commit 561aa8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Core/src/Handlers/Editor/EditorHandler.iOS.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Foundation;
44
using Microsoft.Maui.Devices;
55
using Microsoft.Maui.Graphics;
6+
using Microsoft.Maui.Platform;
67
using UIKit;
78

89
namespace Microsoft.Maui.Handlers
@@ -98,7 +99,7 @@ public static void MapBackground(IEditorHandler handler, IEditor editor)
9899
else if (editor.Background.IsNullOrEmpty())
99100
{
100101
platformView.RemoveBackgroundLayer();
101-
platformView.BackgroundColor = null;
102+
platformView.BackgroundColor = ColorExtensions.BackgroundColor;
102103
}
103104
else
104105
{

0 commit comments

Comments
 (0)