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

[.Net10][Proposal][Android] TabbedPage.PopToRootOnTabReselect property #28563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Mar 22, 2025

Description of Change

This PR introduces a new Android platform specific called TabbedPage.PopToRootOnTabReselectProperty in .NET MAUI TabbedPage. This property allows developers to control whether reselecting the currently active tab should automatically pop its navigation stack to the root page.

On iOS, this behavior is already the default, but on Android, tabs retain their navigation stack when reselected. This property provides a way to align Android’s behavior with iOS, ensuring a consistent user experience across platforms.

Motivation

In many tab-based applications, users expect that tapping an already selected tab should reset its navigation stack, bringing them back to the root of that section. Currently, this behavior must be manually implemented with lots of additional workarounds. This property provides a built-in way to achieve this functionality, improving developer experience and reducing boilerplate code.

Demo

Android iOS
Screen.Recording.2025-03-22.at.16.11.40.mov
Screen.Recording.2025-03-22.at.16.16.45.mov

Usage

<TabbedPage
        xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        x:Class="Maui.Controls.Sample.MainPage"
        xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
        android:TabbedPage.PopToRootOnTabReselect="True">

Issues Fixed

Fixes #27401
Fixes #15301

@kubaflo kubaflo requested a review from a team as a code owner March 22, 2025 15:21
@kubaflo kubaflo self-assigned this Mar 22, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 22, 2025
Copy link
Contributor

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

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PhilMele
Copy link

When could we expect to use this? It's mad a simple task like this requires so much workaround. Big supporter of the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants