Skip to content
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 for unable to select a tab after backing out of a page and returning. #25011

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

BagavathiPerumal
Copy link
Contributor

@BagavathiPerumal BagavathiPerumal commented Sep 30, 2024

Root cause

When navigating back to the main page, the SelectedItem restores its old value instead of clearing it. As a result, when updating with the MapCurrentPage, it does not get updated properly.

Description of Issue Fix

The fix involves setting the SelectedItem property of the NavigationView to null in the disconnect handler to resolve the tab selection issue and setting IsSelected in the MapItemSource to true when page matches view.CurrentPage, addressing the background-related issue.

Also, the issue with the TitleColor of the TabbedPage not updating correctly has been resolved by triggering the PropertyChanged event for TitleColor within the IsSelected property.

Tested the behavior in the following platforms.

  • Windows
  • Android
  • iOS
  • Mac

Issues Fixed

Fixes #24741

Output

Before Issue Fix After Issue Fix
24741-BeforeFix.mp4
24741-AfterFix.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 30, 2024
Copy link
Contributor

Hey there @BagavathiPerumal! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@BagavathiPerumal BagavathiPerumal marked this pull request as ready for review October 4, 2024 12:58
@BagavathiPerumal BagavathiPerumal requested a review from a team as a code owner October 4, 2024 12:58
@PureWeen
Copy link
Member

PureWeen commented Oct 4, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add UI Test please

@BagavathiPerumal
Copy link
Contributor Author

Add UI Test please

@PureWeen, Unfortunately, I'm unable to include a test case for the fix, as it's not possible to add an automation ID for the tab title.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

Added UITest.
uitest-25011

@jsuarezruiz
Copy link
Contributor

/azp-run

@BagavathiPerumal
Copy link
Contributor Author

BagavathiPerumal commented Oct 18, 2024

Added UITest.
uitest-25011

@jsuarezruiz, Thank you for your effort in adding and committing the test case for this complex scenario.

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Oct 22, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.TabbedPage)]
public void SelectTabAfterNavigation()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upload screen shots

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen, I have updated Screenshot for this issue. Could you please validate it once and let me know if there are any further concerns.

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 Servicing milestone Oct 31, 2024

[Test]
[Category(UITestCategories.TabbedPage)]
public void SelectTabAfterNavigation()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated test, simplified. Now is easy to wait or tap elements using both, AutomationId or with the view text.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, Thank you for your effort in updating the test case for this complex scenario.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Nov 7, 2024
@jsuarezruiz jsuarezruiz self-requested a review November 8, 2024 11:56
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@sheiksyedm
Copy link

/rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Unable to select tab after backing out of page and returning
4 participants