Repository navigation
[iOS/MacCatalyst] DatePicker and TimePicker Background is not cleared when set to null at runtime #36934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 5 commits into
dotnet:inflight/current
from
HarishwaranVijayakumar:fix/datepicker-timepicker-background-null-ios
Aug 6, 2026
+199
−1
Merged
[iOS/MacCatalyst] DatePicker and TimePicker Background is not cleared when set to null at runtime #36934
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8970290
Add fix
HarishwaranVijayakumar 9e466ab
Modify testfile names
HarishwaranVijayakumar a7641c9
Add missing baseline images
HarishwaranVijayakumar 38bc8c8
Address concern
HarishwaranVijayakumar 44c2e53
Address AI summary and modify test
HarishwaranVijayakumar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Binary file added
BIN
+35.6 KB
...tests/TestCases.Android.Tests/snapshots/android/Issue36933BackgroundCleared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36 KB
...ests/TestCases.Android.Tests/snapshots/android/Issue36933BackgroundColorSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 36933, "DatePicker and TimePicker Background set to null at runtime does not clear on iOS/MacCatalyst", PlatformAffected.iOS | PlatformAffected.macOS)] | ||
| public class Issue36933 : ContentPage | ||
| { | ||
| public Issue36933() | ||
| { | ||
| var datePicker = new DatePicker | ||
| { | ||
| AutomationId = "TestDatePicker", | ||
| Background = new SolidColorBrush(Colors.LightGreen), | ||
| Date = new DateTime(2025, 1, 15) | ||
| }; | ||
|
|
||
| var timePicker = new TimePicker | ||
| { | ||
| AutomationId = "TestTimePicker", | ||
| Background = new SolidColorBrush(Colors.LightGreen), | ||
| Time = new TimeSpan(10, 30, 0) | ||
| }; | ||
|
|
||
| var clearButton = new Button | ||
| { | ||
| Text = "Set Background to Null", | ||
| AutomationId = "ClearBackgroundButton", | ||
| Command = new Command(() => | ||
| { | ||
| datePicker.Background = null; | ||
| timePicker.Background = null; | ||
| }) | ||
| }; | ||
|
|
||
| var setColorButton = new Button | ||
| { | ||
| Text = "Set Background Color", | ||
| AutomationId = "SetBackgroundButton", | ||
| Command = new Command(() => | ||
| { | ||
| datePicker.Background = new SolidColorBrush(Colors.LightBlue); | ||
| timePicker.Background = new SolidColorBrush(Colors.LightBlue); | ||
| }) | ||
| }; | ||
|
|
||
| Content = new VerticalStackLayout | ||
| { | ||
| Spacing = 20, | ||
| Padding = 30, | ||
| Children = | ||
| { | ||
| datePicker, | ||
| timePicker, | ||
| clearButton, | ||
| setColorButton | ||
| } | ||
| }; | ||
| } | ||
| } |
Binary file added
BIN
+12.9 KB
...ontrols/tests/TestCases.Mac.Tests/snapshots/mac/Issue36933BackgroundCleared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...ntrols/tests/TestCases.Mac.Tests/snapshots/mac/Issue36933BackgroundColorSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36933.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue36933 : _IssuesUITest | ||
| { | ||
| public Issue36933(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "DatePicker and TimePicker Background set to null at runtime does not clear on iOS/MacCatalyst"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.DatePicker)] | ||
| public void VerifyDatePickerAndTimePickerBackgroundClearsOnNull() | ||
| { | ||
| App.WaitForElement("TestDatePicker"); | ||
|
|
||
| Exception? exception = null; | ||
|
|
||
| // Tap clear button to set Background = null — should clear the initial background | ||
| App.Tap("ClearBackgroundButton"); | ||
| VerifyScreenshotOrSetException(ref exception, "Issue36933BackgroundCleared"); | ||
|
|
||
| // Tap set button to set a new background color | ||
| App.Tap("SetBackgroundButton"); | ||
| VerifyScreenshotOrSetException(ref exception, "Issue36933BackgroundColorSet"); | ||
|
|
||
| if (exception is not null) | ||
| { | ||
| throw exception; | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+10.4 KB
...s/tests/TestCases.WinUI.Tests/snapshots/windows/Issue36933BackgroundCleared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
.../tests/TestCases.WinUI.Tests/snapshots/windows/Issue36933BackgroundColorSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.3 KB
...rols/tests/TestCases.iOS.Tests/snapshots/ios-26/Issue36933BackgroundCleared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.1 KB
...ols/tests/TestCases.iOS.Tests/snapshots/ios-26/Issue36933BackgroundColorSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.2 KB
...ontrols/tests/TestCases.iOS.Tests/snapshots/ios/Issue36933BackgroundCleared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.1 KB
...ntrols/tests/TestCases.iOS.Tests/snapshots/ios/Issue36933BackgroundColorSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.