Closed janusw closed 3 weeks ago
I verified that the problem occurs also with the latest MAUI version 8.0.90 and down to 8.0.7.
seems like a good first issue for the new contributor of the repo ;)
I can confirm this issue repro in my scenario
I verified that the problem occurs also with the latest MAUI version 8.0.90 and down to 8.0.7.
For completeness: It also happens with .NET 7 (and with 8.0.81, which was released in the meantime).
By now I suspect that it's rather a bug in Sharpnado.Tabs (and not in the MAUI framework).
I now also set up a reproducer directly in my fork of the Sharpnado.Tabs repo, so that one can debug it directly (together with the lib, and not via the nupkg):
https://github.com/janusw/Sharpnado.Tabs/commits/MauiShellSample/
From the log output and some debugging, I see that TabHostView.OnTabItemTapped
is triggered correctly as long as one stays on the same shell tab. After switching shell tabs, it is not triggered any more, but I currently have no idea why.
@roubachof Do you have any ideas how to debug this? Or some suggestions what to try?
should be linked to this: https://github.com/roubachof/Sharpnado.Tabs/issues/84 maybe?
should be linked to this: #84 maybe?
Quite probable that this is related. Thanks for the pointer!
https://github.com/roubachof/Sharpnado.Tabs/issues/84#issuecomment-2165192578 mentions a solution concerning OnHandlerChanged
. I did some debugging of the TabHostView events and found that:
Unloaded
event is triggered when navigating away from the shell tab that contains the Sharpnado tabsLoaded
and HandlerChanged
events are triggered when navigating back to the shell tab that contains the Sharpnado tabsyup, that's the same for all controls actually.
I tried the following in the OnHandlerChanged
method of the TabHostView
:
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();
InternalLogger.Debug(Tag, () => $"HandlerChanged!");
foreach (var tabItem in Tabs)
{
AddTapCommand(tabItem);
}
}
However, this does not seem to fix the problem. Any comments?
https://github.com/roubachof/Sharpnado.Tabs/issues/84#issuecomment-2165192578 says:
Fixed by reregistering the effect in the OnHandlerChanged override.
Am I doing the wrong thing here? Or maybe it is a different issue, after all ...?!?
well it's not linked to #84 since I cannot reproduce the issue with .net8
should be fixed by v3.1.0, please re-open if it doesn't.
Well, yes, I can confirm that v3.1.0 indeed fixes this problem on Android. Thanks! π
BUT: It looks like this release completely breaks iOS. The tabs do not react to tapping at all on iOS (observed with my own application, have not checked the sample yet). π±
@roubachof Can you confirm this? Have you tested on iOS?
CAn you set UseMauiTapGesture to true on the TabHostView ?
CAn you set UseMauiTapGesture to true on the TabHostView ?
Yes, indeed this makes the tab on iOS react again. Maybe it should be the default then (on iOS)? Or are there any downsides?
I just tested on the sample and it's working fine :
https://github.com/user-attachments/assets/0bb263cf-396e-4fa7-bc34-242d0acdd9f3
I just tested on the sample and it's working fine :
Yes, it's working in principle (i.e. the tabs react to touching), but it's missing the touch effects on the main toolbar (where you set UseMauiTapGesture
). This is the same problem as in my PR #126, which you rejected.
I don't understand... you said:
It looks like this release completely breaks iOS. The tabs do not react to tapping at all on iOS (observed with my own application, have not checked the sample yet). π±
But it does react at tapping, you also have the color feedback. Do you say that you don't have the color feedback on the bottombar ? If yes your PR didn't add color effect, on the contrary it removed it for all tab items.
I don't understand...
Ok, let's get this straight ....
It looks like this release completely breaks iOS. The tabs do not react to tapping at all on iOS (observed with my own application, have not checked the sample yet). π±
This statement concerned my own app: The tabs on iOS did not react at all. This is fixed by using UseMauiTapGesture
.
But it does react at tapping, you also have the color feedback. Do you say that you don't have the color feedback on the bottombar ?
Now you're talking about the MauiSample
app. For this one, the tabs on iOS seems to react, even without UseMauiTapGesture
(you added it for some of the TabHostViews there, e.g. on the MainPage, but not all of them).
However, the color effect when tapping seems to be removed by UseMauiTapGesture
, e.g. on the MainPage. In your screen recording it is also missing for the main tab bar (but it was there before version 3.1.0).
Btw, I also checked that the tabs are reacting in the MauiShellSample. I'm not sure why it did not work in my case.
If yes your PR didn't add color effect, on the contrary it removed it for all tab items.
Right, I did not mean to say that my PR is better than what you did. π
The other way around: Your implementation has the same problem as my naive PR. π (but at least you added a property to switch it).
Would be nice to have one solution that fully works everywhere instead of having workarounds for specific cases.
IIUC, you may need to get rid of the old effects anyway for .NET 9 (in MAUI they we're only kept for compatibility with Xamarin, but it seems like .NET 9 finally removes this compatibility) ...
I am so lost right now :) Let's stop talking on a closed issue and please open new issues if something is not working as expected
I am so lost right now :) Let's stop talking on a closed issue and please open new issues if something is not working as expected
Alright π (#130 seems related).
But you can confirm that the touch effect on the sample's main tab bar is missing right now? That's a "regression" in the sample, in a way.
When you are using UseMauiGesture, it uses maui vanilla gesturen which has no touch effect or tap sound
Platform (please complete the following information):
Describe the bug I see strange behavior of a Sharpnado tab bar inside a MAUI application with Shell Tabbar. In certain situations the Sharpnado tabs become unusable and don't react any more. I'm not actually sure if this is a bug in the MAUI framework itself, or in Sharpnado.Tabs (could be both, I guess).
To Reproduce Steps to reproduce the behavior:
ShellTabBarSample
in my fork of themaui-samples
).