-
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
[Android] Fixed incorrect tab content display in TabbedPage #27294
base: main
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- src/Controls/tests/TestCases.HostApp/Issues/23732Page.xaml: Language not supported
Comments suppressed due to low confidence (1)
src/Controls/tests/TestCases.HostApp/Issues/23732Page.xaml.cs:5
- [nitpick] The class name '_23732Page' is unconventional. It should be renamed to 'Page23732'.
public partial class _23732Page : ContentPage
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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 the failing test is actually valid in this case, please look into that @Vignesh-SF3580
@jfversluis I have validated the test case failure and corrected it by removing the DisconnectHandler call, as the latest code automatically calls previous page's DisconnectHandler during navigation. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
[Test] | ||
[Category(UITestCategories.TabbedPage)] | ||
public void TabbedPageTabContentUpdated() |
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.
This test is failing on Android:
Assert.That(label.GetText(), Is.EqualTo("page4"))
String lengths are both 5. Strings differ at index 4.
Expected: "page4"
But was: "page2"
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 have updated the test cases based on your feedback to avoid the failing. Could you please review and let me know if you have any further concerns?
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
In the attached videos, I see the below had no animations but the after does have.
Is this a result of your fix or was the capture not correct?
@@ -183,7 +183,6 @@ await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(tabbedPage), asy | |||
var nextPage = tabbedPage.Children[pageIndex]; | |||
tabbedPage.CurrentPage = nextPage; | |||
await OnNavigatedToAsync(nextPage); | |||
previousPage.Handler.DisconnectHandler(); |
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.
Why was this removed, is something leaking?
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.
@mattleibow As mentioned earlier, this test fails with a timeout exception when using DisconnectHandler with the fix. Since the latest code automatically calls the previous page's DisconnectHandler during navigation, I have removed this code.
@mattleibow The issue occurs when navigating directly from the first to the fourth tab, where the content does not update properly, and animations are missing. However, animations work when switching between other tabs. My fix ensures the tab content updates correctly, and animations now work as expected when switching from the first to the fourth tab also. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
Still tests consistently failing here
@jfversluis I have checked the test case failures in this PR, and the only failing test is "GridCellsHonorMaxWidth", that failure is not related to the fix I have added. All other tests have passed without any issues. Most probably re triggering the CI will clear the test case failures. Could you please check and let me know if you have any concerns? |
Rebased to avoid the |
/rebase |
165546d
to
be39ba9
Compare
Thanks @jsuarezruiz, for the rebase. |
Issue Detail
When opening the app and clicking directly on the fourth tab, the fifth tab's content is displayed instead of the correct content.
Root Cause:
The OffscreenPageLimit mapping was missing in the source, leading to incorrect preloading of tab contents.
Description of Change
Mapped the OffscreenPageLimit property to ensure proper preloading of tab contents, resolving the issue.
Tested the behavior in the following platforms
Issues Fixed
Fixes #23732
Fixes #21640
Screenshots
TabBarBefore.mov
TabBarAfter.mov