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

feat(Menu): consumed Penta updates #10089

Merged
merged 6 commits into from
Mar 1, 2024
Merged

Conversation

thatblindgeye
Copy link
Contributor

@thatblindgeye thatblindgeye commented Feb 16, 2024

What: Closes #9985, closes #10076

There's some styling issues on hover for the menu item action. This is because in Core there's no pf-v5-c-menu__item-action-icon wrapper around the icon, while in React there is.

Additional issues:

aria-label={ariaLabel}
onClick={onClickButton}
ref={innerRef}
role="menuitem"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should help resolve an aXe error that is related to #9968. This also matches the Core markup.

That said, it'd be worth looking into an alternative to making each button inside a menu a role="menuitem". My concern would be whether it's be totally clear that a user can navigate up/down and left/right inside a menu, or whether the assumption would be that there's only items in a vertical scope.

Comment on lines 98 to 99
/** @hide Sets the role of the button. Should only be used when the button is a descendant of a menu or tablist. */
role?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm hesitant to expose this publicly since it's a very specific use-case. I originally had just imported the button styles into MenuItemAction and applied the necessary class names to a native element, so we could do that instead.

This could be worth exposing to the consumer once we can create some demos on when/how to properly use the prop.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's probably fine to remove this and leave it as an internal prop until we need it to be exposed. But hiding it also works for me.

Copy link
Contributor Author

@thatblindgeye thatblindgeye Feb 20, 2024

Choose a reason for hiding this comment

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

True, we could move the spread props in button to come after all the other props (currently they're spread first). Wasn't sure if there was a particular reason for that or if it's safe to just move that, but that was the reason for adding the hidden role prop.

return (
<Component
{...props}
{...(isAriaDisabled ? preventedEvents : null)}
aria-disabled={isDisabled || isAriaDisabled}
aria-label={ariaLabel}
className={css(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kmcfaul updated

@patternfly-build
Copy link
Contributor

patternfly-build commented Feb 16, 2024

Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

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

Changes lgtm from the react side, but I'm noticing for the drilldown menu that the transition animation only is applying to the first level of menu. @mcoker @mattnolting Any ideas about this? I don't think it's on the react-side since the drilldown logic hasn't been updated.

@mattnolting
Copy link
Contributor

mattnolting commented Feb 20, 2024

Changes lgtm from the react side, but I'm noticing for the drilldown menu that the transition animation only is applying to the first level of menu. @mcoker @mattnolting Any ideas about this? I don't think it's on the react-side since the drilldown logic hasn't been updated.

@kmcfaul We lost a couple variable values. Here's the fix: patternfly/patternfly#6340

@mattnolting
Copy link
Contributor

@andrew-ronaldson Should the favorite button be on the right or left?

Screenshot 2024-02-26 at 12 50 53 PM

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

Nice work, I have a few questions

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

Perfecto! 💯

@@ -182,7 +183,7 @@ const ButtonBase: React.FunctionComponent<ButtonProps> = ({
disabled={isButtonElement ? isDisabled : null}
tabIndex={tabIndex !== null ? tabIndex : getDefaultTabIdx()}
type={isButtonElement || isInlineSpan ? type : null}
role={isInlineSpan ? 'button' : null}
role={isInlineSpan ? 'button' : role}
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

Copy link
Collaborator

@lboehling lboehling left a comment

Choose a reason for hiding this comment

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

lgtm!

@tlabaj tlabaj merged commit fdbac3d into patternfly:v6 Mar 1, 2024
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • @patternfly/react-code-editor@6.0.0-alpha.39
  • @patternfly/react-core@6.0.0-alpha.39
  • @patternfly/react-docs@7.0.0-alpha.41
  • @patternfly/react-drag-drop@6.0.0-alpha.20
  • @patternfly/react-integration@6.0.0-alpha.20
  • demo-app-ts@5.1.1-alpha.38
  • @patternfly/react-table@6.0.0-alpha.39

Thanks for your contribution! 🎉

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.

Calendar month - broken link in docs Consume Penta tokens: Menu
8 participants