-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[.Net10][Proposal]Shell - TabActiveTapped event #30446
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
base: main
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new TabReselected
event in .NET MAUI Shell to let developers react when the active tab is tapped again. It adds internal plumbing, updates platform handlers, and records the new event in the public API unshipped files.
- Adds
SendTabReselected
methods inShellSection
andShell
- Defines a public
TabReselected
event inShell
- Updates iOS and Android renderers to trigger the new event
- Records the new event in all
PublicAPI.Unshipped.txt
files
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/Controls/src/Core/Shell/ShellSection.cs | Added SendTabReselected to propagate reselection |
src/Controls/src/Core/Shell/Shell.cs | Declares public TabReselected event and its invoker |
src/Controls/src/Core/PublicAPI/*/PublicAPI.Unshipped.txt | Records the new public API entry for TabReselected |
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs | Triggers SendTabReselected when the selected VC is tapped again |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs | Implements reselection logic with _initialTabNavigation flag |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs:65
- [nitpick] The field '_initialTabNavigation' is ambiguous; consider renaming it to something like '_hasHandledInitialNavigation' or '_isFirstTabSelection' for clarity.
bool _initialTabNavigation;
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you create a related test?
src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
Outdated
Show resolved
Hide resolved
src/Controls/src/Core/Shell/Shell.cs
Outdated
@@ -1289,7 +1289,7 @@ public ScrollMode FlyoutVerticalScrollMode | |||
|
|||
public event EventHandler<ShellNavigatedEventArgs> Navigated; | |||
public event EventHandler<ShellNavigatingEventArgs> Navigating; | |||
|
|||
public event EventHandler TabReselected; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could add a custom EventArgs with some parameters like the shell section etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can, but what should they include?
Description of Change
This proposal introduces a new TabReselected event for tabs within .NET MAUI Shell. This event is triggered when the user taps on the currently active tab in the bottom tab bar. It provides a consistent and straightforward way for developers to respond to tab reselection scenarios within Shell-based applications.
Motivation
In many modern mobile applications that utilize tab-based navigation, it's a common user expectation that tapping the already active tab performs an action, such as resetting the navigation stack or refreshing the content. Currently, implementing this behavior within .NET MAUI Shell requires manual workarounds and platform-specific logic.
Fixes #27401
Fixes #15301
Fixes #29395