-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix transparent default modal background #23985
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
This file contains 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
Binary file added
BIN
+11 KB
...ls/tests/TestCases.Android.Tests/snapshots/android/VerifyOpaqueModalDefault.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.9 KB
...Android.Tests/snapshots/android/VerifyTransparentModalShowsPageBeneathModal.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 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,75 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, "23973", "Default Modal Page Is Not Transparent", PlatformAffected.All)] | ||
public partial class Issue23973 : ContentPage | ||
{ | ||
public Issue23973() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
new Label(){ | ||
Text = "Label 1" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Click to show opaque default modal page", | ||
Command = new Command(async () => await Navigation.PushModalAsync(new ModalPage())), | ||
LineBreakMode = LineBreakMode.WordWrap, | ||
AutomationId = "PushModal" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Click to show transparent modal page", | ||
Command = new Command(async () => await Navigation.PushModalAsync(new TransparentModalPage())), | ||
LineBreakMode = LineBreakMode.WordWrap, | ||
AutomationId = "PushTransparentModal" | ||
}, | ||
new Label(){ | ||
Text = "Label 2" | ||
}, | ||
new Label(){ | ||
Text = "Label 3" | ||
}, | ||
}; | ||
} | ||
|
||
public class TransparentModalPage : ContentPage | ||
{ | ||
public TransparentModalPage() | ||
{ | ||
Title = "Transparent Modal Page"; | ||
BackgroundColor = Colors.Transparent; | ||
|
||
Content = new VerticalStackLayout() | ||
{ | ||
new Button() | ||
{ | ||
AutomationId = "PopModal", | ||
Text = "If you do not see through to the underlying page, this test has failed", | ||
LineBreakMode = LineBreakMode.WordWrap, | ||
Command = new Command(async () => await Navigation.PopModalAsync()) | ||
} | ||
}; | ||
} | ||
} | ||
|
||
public class ModalPage : ContentPage | ||
{ | ||
public ModalPage() | ||
{ | ||
Title = "Opaque Modal Page"; | ||
|
||
Content = new VerticalStackLayout() | ||
{ | ||
new Button() | ||
{ | ||
AutomationId = "PopModal", | ||
Text = "If you see through to the underlying page, this test has failed", | ||
LineBreakMode = LineBreakMode.WordWrap, | ||
Command = new Command(async () => await Navigation.PopModalAsync()) | ||
} | ||
}; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23973.cs
This file contains 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,34 @@ | ||
#if !MACCATALYST // MACCATALYST doesn't support VerifyScreenshot tests | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue23973(TestDevice device) : _IssuesUITest(device) | ||
{ | ||
protected override bool ResetAfterEachTest => true; | ||
public override string Issue => "Default Modal Page Is Not Transparent"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Navigation)] | ||
public void VerifyOpaqueModalDefault() | ||
{ | ||
App.WaitForElement("PushModal"); | ||
App.Tap("PushModal"); | ||
VerifyScreenshot(); | ||
} | ||
|
||
#if !WINDOWS | ||
[Test] | ||
[Category(UITestCategories.Navigation)] | ||
public void VerifyTransparentModalShowsPageBeneathModal() | ||
{ | ||
App.WaitForElement("PushTransparentModal"); | ||
App.Tap("PushTransparentModal"); | ||
VerifyScreenshot(); | ||
} | ||
#endif | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+7.48 KB
...rols/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyOpaqueModalDefault.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
+25 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyOpaqueModalDefault.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
+50.2 KB
...stCases.iOS.Tests/snapshots/ios/VerifyTransparentModalShowsPageBeneathModal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think BackgroundColor will always fire Background, so this is allocating an array twice and then firing twice for each time the Color is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
Background
Mapper will fire but theBackground
INPC won't fireHere's a quick test