-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Fix for issues caused by setting Shell.FlyoutWidth on WinUI when binding context values are changed #27151
Open
Tamilarasan-Paranthaman
wants to merge
6
commits into
dotnet:main
Choose a base branch
from
Tamilarasan-Paranthaman:fix-19496
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1a711ed
Fixed FlyoutItem issue
Tamilarasan-Paranthaman 3b0657b
Fixed Flyout Issues.
Tamilarasan-Paranthaman dfbfd3a
Merge branch 'main' of https://github.com/Tamilarasan-Paranthaman/mau…
Tamilarasan-Paranthaman aeb88f4
Merge branch 'dotnet:main' into fix-19496
Tamilarasan-Paranthaman 9151fb2
Added test case.
Tamilarasan-Paranthaman 1bcc9c2
Added snapshot for WinUI and Mac
Tamilarasan-Paranthaman 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
+24 KB
...stCases.Android.Tests/snapshots/android/FlyoutItemTextShouldDisplayProperly.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,46 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 19496, "The Shell item text disappears when it is updated dynamically at runtime", PlatformAffected.UWP)] | ||
public partial class Issue19496 : TestShell | ||
{ | ||
int count = 0; | ||
protected override void Init() | ||
{ | ||
FlyoutBackgroundColor = Colors.Gray; | ||
FlyoutWidth = 85; | ||
FlyoutBehavior = FlyoutBehavior.Locked; | ||
|
||
Label label = new Label | ||
{ | ||
Text = count.ToString(), | ||
AutomationId = "FlyoutItemLabel", | ||
TextColor = Colors.White | ||
}; | ||
|
||
ContentPage contentPage = new ContentPage(); | ||
|
||
contentPage.Content = new Button() | ||
{ | ||
Text = "Update Label Text", | ||
AutomationId = "button", | ||
HorizontalOptions = LayoutOptions.Center, | ||
VerticalOptions = LayoutOptions.Center, | ||
Command = new Command(() => | ||
{ | ||
count++; | ||
label.Text = count.ToString(); | ||
}) | ||
}; | ||
|
||
DataTemplate dataTemplate = new DataTemplate(() => | ||
{ | ||
|
||
return label; | ||
}); | ||
|
||
this.ItemTemplate = dataTemplate; | ||
|
||
base.AddFlyoutItem(contentPage, "MainPage"); | ||
} | ||
} | ||
} |
Binary file added
BIN
+48.8 KB
...tests/TestCases.Mac.Tests/snapshots/mac/FlyoutItemTextShouldDisplayProperly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19496.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,27 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue19496 : _IssuesUITest | ||
{ | ||
public override string Issue => "The Shell item text disappears when it is updated dynamically at runtime"; | ||
|
||
public Issue19496(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void FlyoutItemTextShouldDisplayProperly() | ||
{ | ||
App.WaitForElement("button"); | ||
App.Tap("button"); | ||
App.Tap("button"); | ||
App.Tap("button"); | ||
App.Tap("button"); | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+8.65 KB
...TestCases.WinUI.Tests/snapshots/windows/FlyoutItemTextShouldDisplayProperly.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.2 KB
...tests/TestCases.iOS.Tests/snapshots/ios/FlyoutItemTextShouldDisplayProperly.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.
Could include an UITest and use get the Label counter value to validate it with an Assert?
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.
@jsuarezruiz, ensuring this through an assert was not functioning properly in this scenario, possibly because the text only disappeared from the view. As a result, the test passed without this fix. I have added a UI test with VerifyScreenshot to address the issue. Could you please review it and share your feedback?