MicrosoftDocs / CommunityToolkit

The Official Docs for the Community Toolkits
https://learn.microsoft.com/dotnet/communitytoolkit
Creative Commons Attribution 4.0 International
109 stars 90 forks source link

Tabs in section 'Platform specific initialization' are behaving strangely #437

Open dcarapic opened 3 months ago

dcarapic commented 3 months ago

Type of issue

Other (describe below)

Description

Clicking individual tabs on the within the 'Platform specific initialization' section does not work correctly. firefox_2024-07-04_08-47-01

Page URL

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/alerts/toast?tabs=tizen%2Cmacios%2Candroid

Content source URL

https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/maui/alerts/toast.md

Document Version Independent Id

8536c827-5a35-ebdd-51fd-0a184bfe1d69

Article author

@VladislavAntonyuk

Metadata

bijington commented 3 months ago

@Davidbritch do you have any idea what might cause this?

davidbritch commented 3 months ago

@bijington

The URL gives away what the problem is: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/alerts/toast?tabs=tizen%2Cmacios%2Candroid - it's trying to display multiple tabs at once, rather than a single tab. This occurs because you have unbalanced tab groups on the page. The first tab group has 4 tabs, the second tab group has 2 tabs (and one of them uses a different tab id). So, for example, if you delete the second tab group on the page (with 2 tabs), the first tab group works correctly. The first tab group also works correctly if you have four tabs in the second tab group, and use the same tab ids.

So ultimately the solution is to balance up the two tab groups.

davidbritch commented 2 months ago

@bijington

There's a second solution: ensure the tab ids in one of the tab groups are different to the tab ids in the other group. With this approach you can keep 4 tabs in the first group, and 2 in the second.