-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fixed Flyout icon not updating when root page changes using InsertPageBefore #29924
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
Open
Vignesh-SF3580
wants to merge
6
commits into
dotnet:main
Choose a base branch
from
Vignesh-SF3580:fix-iOSInsertpageBefore
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
e040215
Fixed InsertPageBefore issue in iOS
Vignesh-SF3580 849f017
Fix updated
Vignesh-SF3580 edd63ae
Added testcases.
Vignesh-SF3580 7b42edf
updated testcases.
Vignesh-SF3580 c99fb14
Added mac and windows images.
Vignesh-SF3580 0c26e1f
Updated NavigationRenderer.cs
Vignesh-SF3580 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 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
Binary file added
BIN
+22.1 KB
...ases.Android.Tests/snapshots/android/FlyoutIconUpdatedAfterInsertPageBefore.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,63 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 29921, "Flyout icon not replaced after root page change", PlatformAffected.iOS)] | ||
public class Issue29921 : FlyoutPage | ||
{ | ||
public Issue29921() | ||
{ | ||
Detail = new NavigationPage(new Issue29921Page1()); | ||
Flyout = new ContentPage | ||
{ | ||
Title = "Flyout Page", | ||
IconImageSource = "menu_icon.png", | ||
Content = new Label | ||
{ | ||
Text = "This is flyout", | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center | ||
} | ||
}; | ||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; | ||
} | ||
} | ||
|
||
public class Issue29921Page1 : ContentPage | ||
{ | ||
public Issue29921Page1() | ||
{ | ||
Title = "Page 1"; | ||
var insertBeforeButton = new Button { Text = "Insert Page Before", AutomationId = "InsertPageButton" }; | ||
insertBeforeButton.Clicked += InsertBefore_Clicked; | ||
Content = new StackLayout | ||
{ | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center, | ||
Children = { insertBeforeButton } | ||
}; | ||
} | ||
|
||
private void InsertBefore_Clicked(object sender, EventArgs e) | ||
{ | ||
if (Parent is NavigationPage navPage) | ||
{ | ||
navPage.Navigation.InsertPageBefore(new Issue29921Page2(), navPage.RootPage); | ||
} | ||
} | ||
} | ||
|
||
public class Issue29921Page2 : ContentPage | ||
{ | ||
public Issue29921Page2() | ||
{ | ||
Title = "Page 2"; | ||
Content = new StackLayout | ||
{ | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center, | ||
Children = | ||
{ | ||
new Label { Text = "Flyout icon is visible", AutomationId = "Page2Label" }, | ||
} | ||
}; | ||
} | ||
} |
Binary file added
BIN
+7.96 KB
...ts/TestCases.Mac.Tests/snapshots/mac/FlyoutIconUpdatedAfterInsertPageBefore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29921.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,22 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue29921 : _IssuesUITest | ||
{ | ||
public Issue29921(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
public override string Issue => "Flyout icon not replaced after root page change"; | ||
|
||
[Test] | ||
[Category(UITestCategories.FlyoutPage)] | ||
public void FlyoutIconUpdatedAfterInsertPageBefore() | ||
{ | ||
App.WaitForElement("InsertPageButton"); | ||
App.Tap("InsertPageButton"); | ||
VerifyScreenshot(); | ||
} | ||
} |
Binary file added
BIN
+7.53 KB
...tCases.WinUI.Tests/snapshots/windows/FlyoutIconUpdatedAfterInsertPageBefore.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
+29.2 KB
...ts/TestCases.iOS.Tests/snapshots/ios/FlyoutIconUpdatedAfterInsertPageBefore.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.
Pending snapshot on Mac and Windows.

Could you commit the images?
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 I have updated the pending snapshots for Mac and Windows.