-
Notifications
You must be signed in to change notification settings - Fork 730
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(iOS) CommandBar updates on navigation #3017 #4287
fix(iOS) CommandBar updates on navigation #3017 #4287
Conversation
Is there a way to create an automated test for that? |
Good question but honestly I am not really sure if this is possible. The test would be time-sensitive in order to reproduce it. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
9c01a8e
to
48d1b0a
Compare
For the tests, does it reproduce inside an uno sample control, manually ? |
To reproduce it we would require 2 pages both with |
Here's a test that's doing that: https://github.com/unoplatform/uno/blob/master/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Controls/CommandBarTests/UnoSamples_Tests.NativeCommandBar.cs#L68
|
d51eeba
to
4897a14
Compare
c03ea51
to
f97545a
Compare
if (pageController.FindTopCommandBar() is { } topCommandBar) | ||
{ | ||
// Set the native navigation bar to null so it does not render when the page is not visible | ||
SetNavigationBar(topCommandBar, null!); |
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.
null!
is not a thing you should ever write if you can avoid it. Rather you should change the called signature to SetNavigationItem(CommandBar commandBar, UIKit.UINavigationItem? navigationItem)
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.
null!
is not a thing you should ever write if you can avoid it. Rather you should change the called signature toSetNavigationItem(CommandBar commandBar, UIKit.UINavigationItem? navigationItem)
I just followed the implementation of similar methods ex: PageDidDisappear
as I did not want to do refactoring on code I did not add.
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.
Will push another PR doing this refactoring
@Mergifyio backport release/beta/3.1 |
Command
|
GitHub Issue (If applicable): #
closes #3017
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Changing the Background property on the CommandBar on Page1 while navigating to Page2 changes the CommandBar on Page2.
What is the new behavior?
Changes on one Page CommandBar will not affect other page's CommandBar
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):