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 Tab is still visible after set Tab.IsVisible to false #24999

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

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Sep 30, 2024

Description of Change

When the visibility of the TabItem is changed dynamically, TabBar needs to be updated to reflect the TabBar items count, but hiding the visible TabItem updates the TabContent but doesn't automatically adjust the tab count.

Issues Fixed

Each time the DisplayedPage is modified,we have updated the TabBar items count through setupmenu().

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Fixes #8788
Fixes #23717
Fixes #23780

Before

Shell_before_fix.mp4

After

Shell_After_fix.mp4

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

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

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review October 3, 2024 12:30
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner October 3, 2024 12:30
if (renderer?.ViewController != SelectedViewController)

if (renderer is null)
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is returning too soon. CurrentRenderer isn't updated

@@ -432,7 +432,7 @@ void OnCurrentShellSectionPropertyChanged(object? sender, System.ComponentModel.
if (_mainLevelTabs == null)
return;

var currentItem = VirtualView.CurrentItem.CurrentItem;
var currentItem = VirtualView.CurrentItem?.CurrentItem;
Copy link
Contributor

Choose a reason for hiding this comment

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

did we enable nullable here ?

@@ -270,7 +270,7 @@ void OnVisibleChildRemoved(Element child)
if (CurrentItem == child)
{
if (ShellItemController.GetItems().Count == 0)
ClearValue(CurrentItemProperty, specificity: SetterSpecificity.FromHandler);
ClearValue(CurrentItemProperty);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the rationale for dropping the specificity ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
2 participants