feat(Stack v5, iOS): Add keepsMenuPresented prop to menuItems#4261
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for keeping the iOS Stack v5 header menu presented after tapping a menu item by introducing a new keepsMenuPresented option and wiring it through the JS types, native menu mapping, and native menu element construction.
Changes:
- Added
keepsMenuPresentedto the iOS stack header menu item types (Fabric + public TS types). - Passed
keepsMenuPresentedthrough iOS native menu mapping/data structures and appliedUIMenuElementAttributesKeepsMenuPresentedwhen available (iOS/tvOS 16+). - Updated the Stack Header Menu iOS single-feature-test to exercise the new option.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/fabric/gamma/stack/StackHeaderItemIOSNativeComponent.ts | Extends Fabric menu item shape to include keepsMenuPresented. |
| src/components/gamma/stack/header/ios/StackHeaderMenu.ios.types.ts | Documents and types the new keepsMenuPresented prop for menu items. |
| ios/gamma/stack/header/RNSStackHeaderMenuMapper.mm | Maps keepsMenuPresented from JS dictionaries into native menu item data and validates the new key. |
| ios/gamma/stack/header/RNSStackHeaderMenuData.h | Adds keepsMenuPresented storage on RNSStackHeaderMenuItemData and updates initializer signature. |
| ios/gamma/stack/header/RNSStackHeaderMenuData.mm | Implements the updated initializer and stores _keepsMenuPresented. |
| ios/gamma/stack/header/RNSStackHeaderMenuCoordinator.mm | Applies UIMenuElementAttributesKeepsMenuPresented to actions/toggles when requested and supported. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-header-menu-ios/index.tsx | Adds UI to toggle keepsMenuPresented in the iOS header menu SFT scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
t0maboro
approved these changes
Jul 3, 2026
b81a8a2 to
94c83c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
keepsMenuPresentedto configurable options on menu items. When action withkeepsMenuPresented == trueis clicked, the menu is still displayed. This only really works correctly on top-level menus (also on native), nested menus are hidden anyways (all but the top-level menu).Changes
keepsMenuPresentedprop and handled on menu buildingVisual documentation
keeps-menu-presented.mov
Note
This flashing when first checkmark is added or last checkmark is removed also appears natively. There's nothing we can do about it
Test plan
Use Stack Header Menu SFT
Checklist