Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu/MenuItem - should support drill-[up/out] icon/layout in menu list #9653

Open
mcoker opened this issue Sep 20, 2023 · 1 comment
Open

Comments

@mcoker
Copy link
Contributor

mcoker commented Sep 20, 2023

re: #9587 and this issue to make the same update in core patternfly/patternfly#5950. Not sure if this is a breaking change or not, probably depends on how we go about implementing it.

In the drilldown with breadcrumb menu examples, in the breadcrumb dropdown, we have items that present (and seem to function) as drill-[up/out] items with a back arrow at the start of the item, and clicking on the item takes you up a level in the breadcrumb hierarchy. However, our component doesn't support this layout - our examples are using a user-supplied icon passed as the icon prop -

<DropdownItem
key="dropdown-start"
icon={<AngleLeftIcon />}
onClick={(event: any) =>
drillOut(event, 'breadcrumbs-drilldownMenuStart', 'group:app_grouping_start', startRolloutBreadcrumb)
}
>
Start rollout
</DropdownItem>

Some issues with this are:

  1. It doesn't work by default in RTL since we can't predictably target and mirror/flip that menu item icon for the user since that could be a non-directional icon or they may have opted for some other type of directional icon there that shouldn't be flipped.
  2. Since it's a user supplied icon, there is the possibility for inconsistency
  3. I could be wrong, but I don't know if a user could pass an actual icon to any of those items since the prop is being used for the back arrow.

We have a direction="up" prop that puts the correct icon container and icon on a drill-up/out icon and works in RTL, but that is specific to the top/first item in a drilled-in drilldown menu. The prop applies other logic to that item that isn't appropriate for use in the breadcrumb items, so we can't use that prop there.

{direction === 'up' && (
<span className={css(styles.menuItemToggleIcon)}>
<AngleLeftIcon aria-hidden />
</span>
)}

Ideally we could do something like update the direction prop so it could be used in these breadcrumb menu items or maybe introduce some new kind of prop for an item that indicates clicking it does some kind of "back" action and it just borrows the way direction="up" includes the icon in the item.

Copy link

stale bot commented Jan 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jan 9, 2024
@stale stale bot closed this as completed Jan 26, 2024
@mcoker mcoker added the Pinned label Jan 26, 2024
@mcoker mcoker reopened this Jan 26, 2024
@stale stale bot removed the wontfix label Jan 26, 2024
@kmcfaul kmcfaul removed the Tech debt label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

3 participants