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

Fixed Shell Navigating event issue when switching tabs #25749

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Vignesh-SF3580
Copy link
Contributor

Issue Detail

Mac and iOS: Clicking on an already-selected tab triggered the Navigating event unnecessarily.
Windows: The Navigating event was not triggered when switching tabs.

Root Cause

Mac and iOS: The event was triggered without checking if the tab was already selected.
Windows: There was no code in place to trigger the Navigating event upon tab switches.

Description of Change

Mac and iOS: Modified the code to trigger Navigating only if a new tab is selected.
Windows: Added logic to trigger Navigating when switching to a different tab.

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #25599

Screenshots

Before Issue Fix After Issue Fix
BeforeFix.mov
AfterFix.mov

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

Hey there @Vignesh-SF3580! 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 jsuarezruiz added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Nov 11, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

var r = RendererForViewController(viewController);
if (r != null)
if (r is not null && r != SelectedViewController)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could include an UITest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the test case. Could you please review it and let me know if you have any concerns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnNavigating wrong target when tapping the same tab
2 participants