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

Merged
merged 11 commits into from
Jan 15, 2025
Prev Previous commit
Next Next commit
fix-24741-Optimized the fix by making SelectedItem null in DisConnect…
…Handler.
  • Loading branch information
BagavathiPerumal authored and jsuarezruiz committed Nov 8, 2024
commit 89016af631e91da9997261f1648c11f8a2962b52
11 changes: 3 additions & 8 deletions src/Controls/src/Core/TabbedPage/TabbedPage.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ void OnHandlerDisconnected(FrameworkElement? platformView)
{
_navigationView.OnApplyTemplateFinished -= OnApplyTemplateFinished;
_navigationView.SizeChanged -= OnNavigationViewSizeChanged;

if (_navigationView.MenuItemsSource is ObservableCollection<NavigationViewItemViewModel> items)
{
foreach (var item in items)
{
item.IsSelected = false;
}
}
}

if (platformView is WFrame wFrame)
Expand All @@ -142,7 +134,10 @@ void OnHandlerDisconnected(FrameworkElement? platformView)
Appearing -= OnTabbedPageAppearing;
Disappearing -= OnTabbedPageDisappearing;
if (_navigationView != null)
{
_navigationView.SelectedItem = null;
_navigationView.SelectionChanged -= OnSelectedMenuItemChanged;
}

OnTabbedPageDisappearing(this, EventArgs.Empty);

Expand Down