Skip to content

feat(Stack v5, iOS): Add keepsMenuPresented prop to menuItems#4261

Merged
kmichalikk merged 4 commits into
mainfrom
@kmichalikk/keeps-menu-presented
Jul 6, 2026
Merged

feat(Stack v5, iOS): Add keepsMenuPresented prop to menuItems#4261
kmichalikk merged 4 commits into
mainfrom
@kmichalikk/keeps-menu-presented

Conversation

@kmichalikk

Copy link
Copy Markdown
Contributor

Description

This PR adds keepsMenuPresented to configurable options on menu items. When action with keepsMenuPresented == true is 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

  • added keepsMenuPresented prop and handled on menu building
  • updated typing
  • updated menu SFT

Visual 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

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

@kmichalikk kmichalikk self-assigned this Jul 3, 2026
@kmichalikk kmichalikk requested review from Copilot, kligarski and t0maboro and removed request for kligarski July 3, 2026 13:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 keepsMenuPresented to the iOS stack header menu item types (Fabric + public TS types).
  • Passed keepsMenuPresented through iOS native menu mapping/data structures and applied UIMenuElementAttributesKeepsMenuPresented when 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.

Comment thread src/components/gamma/stack/header/ios/StackHeaderMenu.ios.types.ts
Comment thread ios/gamma/stack/header/RNSStackHeaderMenuMapper.mm Outdated
Comment thread ios/gamma/stack/header/RNSStackHeaderMenuCoordinator.mm Outdated
Comment thread ios/gamma/stack/header/RNSStackHeaderMenuCoordinator.mm Outdated
Base automatically changed from @kmichalikk/header-items-decouple to main July 6, 2026 08:39
@kmichalikk kmichalikk force-pushed the @kmichalikk/keeps-menu-presented branch from b81a8a2 to 94c83c5 Compare July 6, 2026 10:09
@kmichalikk kmichalikk merged commit 7624a9c into main Jul 6, 2026
8 checks passed
@kmichalikk kmichalikk deleted the @kmichalikk/keeps-menu-presented branch July 6, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants