UIMenuElementAttributesKeepsMenuPresented not working when Glass Grouping changes

I'm working on a UIBarButtonItem that is supposed to be a filter button - it shows a menu in which the user can (un)check menu items. Using the UIMenuElementAttributesKeepsMenuPresented attribute on the UIActions prevents the menu to hide after the user clicks an item.

The button is put alongside another button as the leftBarButtonItems of my navigation item. In iOS 26 they are grouped into a single glass container automatically.

Now when the user starts filtering, I want to highlight the UIBarButton item to signal to the user that the filter is active (similar to what Apple does in the Mail app). I do that by setting the UIBarButtonItemStyle to prominent. Now that works too, but it causes the automatic glass grouping to break up and the menu to hide.

I'm fine with the grouping to break up, but the menu shouldn't hide. Is this a bug or can this be prevented somehow?

Thank you for your post. I am currently attempting to understand the concept you are describing, but I would greatly appreciate it if you could provide a more detailed explanation in a form or a focused sample.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Albert Pascual
  Worldwide Developer Relations.

UIMenuElementAttributesKeepsMenuPresented not working when Glass Grouping changes
 
 
Q