After updating our usage of CursorMenuItemProps to no longer reference the deprecated item?: CommandItemProps; we are finding that the UiFramework.openCursorMenu fails to render the items. We took the advise of the comment above the deprecated field which reads Use properties of this object instead.; however, despite moving the label, icon and execute properties to be inline with the rest of the CurosrMenuItemProps the issue persists.
have a viewer instance running that is at least on appui v4.15 with a menu built from CursorMenuItemProps where the item field has been replaced by merging its props into the object itself.
have a way to visualize these menu items by passing them to UiFramework.openCursorMenu
notice that the menu items do not appear and only a thin vertical line where the menu would otherwise be shown is visible
Expected Behavior
The expectation is that the menu shows exactly the same as it does when the CommandItemProps are on the item field instead of merged inline with the rest of the CursorMenuItemProps
Screenshots
Before:
After:
Desktop (please complete the applicable information)
Describe the bug
After updating our usage of
CursorMenuItemProps
to no longer reference the deprecateditem?: CommandItemProps;
we are finding that theUiFramework.openCursorMenu
fails to render the items. We took the advise of the comment above the deprecated field which readsUse properties of this object instead.
; however, despite moving thelabel
,icon
andexecute
properties to be inline with the rest of theCurosrMenuItemProps
the issue persists.From debugging the issue, it appears that the
MenuItem
class that is leveraged to produce the menu items thatUiFramework.openCursorMenu
uses does not have logic to find thelabel
,iconSpec
,badgeType
,badgeKind
, andisDisabled
unless the props can be found on theitem
field that is deprecated see https://github.com/iTwin/appui/blob/b6a5e1810fc9c23327dfb348df5383e7f9ef8e74/ui/appui-react/src/appui-react/shared/MenuItem.tsx#L126To Reproduce
CursorMenuItemProps
where theitem
field has been replaced by merging its props into the object itself.UiFramework.openCursorMenu
Expected Behavior
The expectation is that the menu shows exactly the same as it does when the
CommandItemProps
are on theitem
field instead of merged inline with the rest of theCursorMenuItemProps
Screenshots
Before:
After:
Desktop (please complete the applicable information)
Additional context
No response