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

fix(menu): added display hidden to :not(.pf-m-current-path) .pf-c-menu #4980

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

mattnolting
Copy link
Contributor

@mattnolting mattnolting commented Jul 18, 2022

closes #4870

After testing, the removal of pf-m-hidden and pf-m-visible modifiers has no affect on the drilldown variant for .pf-c-menu__list-item. Neither class is present in the DOM or used in any of the interaction states. We need to retain the class to prevent a breaking change, but the mixin isn't necessary to use.

@patternfly-build
Copy link

patternfly-build commented Jul 18, 2022

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

TIL about this https://codepen.io/mcoker/pen/BarWpjy! I didn't know that was possible.

Traditionally we've required both display: none and visibility: hidden on an element to hide it across all the things we cared about - this will remove visibility from the hidden/visible classes on list items if users are hiding/showing them for other reasons. Is that OK?

Does display: none on the nested/hidden menus not work? Changing it in the react component like Eric mentioned seems to work - the parent menu height is still computed correctly.

@mattnolting
Copy link
Contributor Author

mattnolting commented Jul 19, 2022

@mcoker after some more testing, the issue appears to be with &:not(.pf-m-current-path) .pf-c-menu not also being set to display: none. Try this solution out @thatblindgeye and let me know what you think.

@mattnolting
Copy link
Contributor Author

mattnolting commented Jul 19, 2022

@mcoker @thatblindgeye There's also an issue with pf-c-divider being counted in child DOM elements, so VO announces the second li after a divider as "{title} item 3 of 6" instead of "{title} 2 of 5". I think we either need to aria-hidden="true" this, as we did with the nested table column headers, or hide otherwise.

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🥳

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Tested on both the React menu drilldown and nav drilldown examples and it looks to work great! 🎉 I did initially notice at first on the nav drilldown when trying to apply the styles to the appropriate selector that the second level menu (after clicking the "Item 1" item) wasn't displaying, but after trying again I wasn't able to replicate the issue.

@mattnolting mattnolting changed the title fix(menu): removed hidden-visible usage fix(menu): added display hidden to &:not(.pf-m-current-path) .pf-c-menu Jul 19, 2022
@mattnolting mattnolting changed the title fix(menu): added display hidden to &:not(.pf-m-current-path) .pf-c-menu fix(menu): added display hidden to :not(.pf-m-current-path) .pf-c-menu Jul 19, 2022
@mcoker mcoker merged commit dc786e8 into patternfly:main Jul 20, 2022
@patternfly-build
Copy link

🎉 This PR is included in version 4.204.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Bug - Menu - drilldown variant has hidden submenus accessible via VO
4 participants