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(OverflowMenu): Use next dropdown and dropdownItems #8359
Conversation
Preview: https://patternfly-react-pr-8359.surge.sh A11y report: https://patternfly-react-pr-8359-a11y.surge.sh |
packages/react-core/src/components/OverflowMenu/OverflowMenuDropdownItem.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainer.tsx
Outdated
Show resolved
Hide resolved
b35f734
to
f611728
Compare
@@ -16,6 +16,7 @@ propComponents: | |||
import AlignLeftIcon from '@patternfly/react-icons/dist/esm/icons/align-left-icon'; | |||
import AlignCenterIcon from '@patternfly/react-icons/dist/esm/icons/align-center-icon'; | |||
import AlignRightIcon from '@patternfly/react-icons/dist/esm/icons/align-right-icon'; | |||
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add imports here before they're used in examples below
import { Dropdown, DropdownList } from '@patternfly/react-core/next'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using an alias for Dropdown to call it DropdownNext in the examples, are we setting a precedent that will make updating the imports in the future harder for doing, with codemods for example, for people who copy that pattern and later want to switch from the next dropdown to the official dropdown, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I am noticing that in the examples, the menu width is only as wide as the kebab toggle, so all but the first letter the menu items get cut off. We could pass minWidth
to the DropdownNext in the examples or expose the popperMatchesTriggerWidth
prop in the Next Dropdown component to set it on Popper.
@mcoker what are your thoughts on this? |
de1ffb7
to
1a02596
Compare
@tlabaj since it's a dropdown menu, the menu should ideally have a min-width of the toggle width, but should grow to fit the size of the menu content if the content is wider than the toggle. |
9429475
to
ff6d6c0
Compare
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Show resolved
Hide resolved
@thatblindgeye @mcoker this issue has been opened to address menu widths #8682 Should I leave this as is for now or add a width in the interim? |
@tlabaj IMO leave it as is, and update components that use popper to have the appropriate size set either as part of #8682, or maybe separate tasks for each thing that needs to be updated. I may be misunderstanding, but that issue says it will set defaults for |
@mcoker correct |
packages/react-core/src/components/OverflowMenu/examples/OverflowMenu.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainer.tsx
Outdated
Show resolved
Hide resolved
@erik @nicolethoen Correct. the alias is a temp solution until we deprecate old dropdown. Since there is an issue in the framework. |
This reverts commit 92ff72c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above demos look to be loading now.
The below comment would also apply to Table's "Composable: Actions Overflow" example, as it has a similar class/styling issue.
packages/react-core/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainer.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproving for the above comments from Sarah and myself 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Is there something specific I should be looking for?
@mcarrano Just that the overflow menu appears as expected with the Next dropdown implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Is there something specific I should be looking for?
@mcarrano Just that the overflow menu appears as expected with the Next dropdown implementation.
It does!
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #8071
Updated the OverflowMenu to
Additional issues: