Skip to content

Shell Tab is still visible after set Tab.IsVisible to false #8788

@SamShanWang

Description

@SamShanWang

Description

In the beginning, there is one tab visible ( tab 1 ) and two tabs hidden ( tab 2 and tab 3 ) on a TabBar. Then I want to display tab 2 and tab 3. Meanwhile, hide tab 1.

  1. Here is the code to do it.

Tab2.IsVisible = true;
Tab3.IsVisible = true;
Tab1.IsVisible = false;

Run in Android platform, the result is:
image
If you tap 'Tab 3' tab header, the app will crash.

When run in Windows platform, the result is correct.

  1. If I use the code below.

Tab1.IsVisible = false;
Tab2.IsVisible = true;
Tab3.IsVisible = true;

Then run in Android platform, the result is correct.
image

But run in Windows platform, the app will crash.

A repro project is provided: https://github.com/SamShanWang/maui-shell-tab-hide-bug.git

Steps to Reproduce

  1. Load repro project in VS and run on Android platform.
  2. Click the menu item 'Tap me to reproduce bug on android' on flyout.
  3. Notice the view of TabBar.
  4. Tap 'Tab 3' tab header, the app crashes.
  5. Then run on Windows platform.
  6. Click the menu item 'Tap me to reproduce bug on windows' on flyout. Then the app crashes.

Version with bug

9.0.408 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows, I was not able test on other platforms

Affected platform versions

Android 7.1, Android 9.0, Windows 10 version 19044.1826, I was not able test on other platform versions

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions