dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.16k stars 1.74k forks source link

TabBar buttons won't return from a pushed page in Android. Works in iOS. #8986

Open polygonsheep opened 2 years ago

polygonsheep commented 2 years ago

Description

Attached a basic example app. There are 2 tabs on the TabBar, "Home" and "About". Each has a page associated.

From the Home page you can click a button to load a new "Details" page. Once on the Details page, iOS allows you to return to the Home page by clicking the Home TabBar icon. On Android, clicking the Home TabBar icon does nothing and you can never get back to the Home page.

See attached TabBarBug app.

Steps to Reproduce

TabBarBug.zip

Version with bug

6.0.408 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

no

Relevant log output

No response

jfversluis commented 2 years ago

Hey there, thanks for the report! Could you please provide the repro through a GitHub repo for us to look at please? Thanks!

ghost commented 2 years ago

Hi @polygonsheep. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

polygonsheep commented 2 years ago

ok, hopefully this worked. I don't use github normally. https://github.com/polygonsheep/TabBarBug

polygonsheep commented 2 years ago

Looked into this more. On Android, OnNavigating(ShellNavigatingEventArgs args) is never called when tapping the same TabBar icon successive times.

On iOS, it is called every time you click a TabBar icon even successive taps of the same icon.

ghost commented 1 year ago

Hi @polygonsheep. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

homeyf commented 1 year ago

Verified this issue with Visual Studio Enterprise 17.6.0 Preview 7.0. Not repro on Android platform with above project. repro project: TabBarBug.zip demo2

polygonsheep commented 1 year ago

This bug is NOT fixed! What you are doing above is just switching between 2 tabs. On the home page you need to hit "Show Details". At that point you cannot return to the home page by clicking the home icon. Only a problem on Android.

polygonsheep commented 1 year ago

Updated project with latest Maui. https://github.com/polygonsheep/TabBarBug

myrup commented 1 year ago

Also affected by this! Can't come up with a workaround besides reimplementing the TabBar 😒. Can anyone think of a way to detect that second tap?

SliemBeji-FBC commented 11 months ago

We aswelll are affected. Microsoft please fix thouse issues

Remusqs1 commented 6 months ago

Still happening in the latest version for Android.

Has anyone found a workaround to this?

Remusqs1 commented 5 months ago

It seems that this bug comes from Xamarin.Forms, it was reported almost 5 years ago on that platform and was not fixed. See: https://github.com/xamarin/Xamarin.Forms/issues/6544

Maui inherited this problem from Xamarin.Forms, this bug was reported almost 2 years ago for Maui and there does not seem to be an interest in solving it.