From 982d4f67c3393f323c476cd3c17dacdafac53bed Mon Sep 17 00:00:00 2001 From: Mir Bhatia Date: Wed, 1 Oct 2025 12:10:38 +0200 Subject: [PATCH] Update SubMenuItem to delegate items call to SubMenu --- .changeset/hip-clowns-visit.md | 5 +++++ app/components/primer/alpha/action_menu/sub_menu_item.rb | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/hip-clowns-visit.md diff --git a/.changeset/hip-clowns-visit.md b/.changeset/hip-clowns-visit.md new file mode 100644 index 0000000000..e02c923443 --- /dev/null +++ b/.changeset/hip-clowns-visit.md @@ -0,0 +1,5 @@ +--- +'@openproject/primer-view-components': patch +--- + +Delegate the items call to SubMenu of ActionMenu component diff --git a/app/components/primer/alpha/action_menu/sub_menu_item.rb b/app/components/primer/alpha/action_menu/sub_menu_item.rb index c91942b036..11abbee757 100644 --- a/app/components/primer/alpha/action_menu/sub_menu_item.rb +++ b/app/components/primer/alpha/action_menu/sub_menu_item.rb @@ -6,6 +6,8 @@ class ActionMenu # This component is part of <%= link_to_component(Primer::Alpha::ActionMenu) %> and should not be # used as a standalone component. class SubMenuItem < ::Primer::Alpha::ActionList::Item + delegate :items, to: :@sub_menu + def initialize(content_arguments: {}, form_arguments: {}, **system_arguments) # We extract form_arguments from system_arguments here to avoid passing them to the # ActionList::Item base class or to the SubMenu instance. Doing so prevents a form