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): add overflow and max-height so that a scrollbar is visible for long lists #41

Merged
merged 11 commits into from
Oct 2, 2023

Conversation

kaydwithers
Copy link
Contributor

@kaydwithers kaydwithers commented Sep 27, 2023

Why

This PR adds a scrollbar, similar to the Select component scrollbar.

When a Menu has a lot of list items then the list can sometimes go outside the page. This change will allow a scrollbar to be visible for long lists.

22rem is the same max-height as the Select component.

What

Before
image

After
image

Select with scrollbar dropdown for reference.
image

this will give Menu a scrollbar which is ideal for long lists, it uses the same max-height as the Select component
@kaydwithers kaydwithers requested a review from a team as a code owner September 27, 2023 21:42
@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2023

🦋 Changeset detected

Latest commit: 3a83c98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kaizen/draft-menu Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2023

✨ Here is your branch preview! ✨

Last updated for commit 3a83c98: fix: remove capital letter

Copy link
Contributor

@mcwinter07 mcwinter07 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @kaydwithers. I'm thinking it'd also be great to capture an additional example in the stickersheet stories to showcase the max number of items before the overflow kicks in when the menu is open.

Screenshot 2023-09-28 at 9 52 50 am

@kaydwithers
Copy link
Contributor Author

Thanks for the contribution @kaydwithers. I'm thinking it'd also be great to capture an additional example in the stickersheet stories to showcase the max number of items before the overflow kicks in when the menu is open.

Screenshot 2023-09-28 at 9 52 50 am

Thanks @mcwinter07, I've added a new "Short list" story.

@@ -79,6 +79,29 @@ const StickerSheetTemplate: StoryFn<{ isReversed: boolean }> = ({
}) => (
<StoryWrapper isReversed={isReversed}>
<StoryWrapper.RowHeader headings={["Default", "Icon Button"]} />

<StoryWrapper.Row rowTitle="Short list">
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the update @kaydwithers - I have a few small tweaks before I give the PR the green light. Instead of the Short list example being a new row, could we instead move this into the "open" and "closed" with the respective states rows so we can visually capture the these for chromatic. We'll need a title added to headings in ln81.

With an open an close state for the shorter list our snapshots can capture what the menu looks like without the scroll bar so any change to the menu items size impact overflow can be caught in visual regression.

Shout out if you have any further queries :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcwinter07 I've added short/long list open examples, is that better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Main reason I'd say we should have them both in the stickersheet stories is that this is what we send to chromatic. By default our stickersheet stories are the only ones we send to chromatic to reduce the overall spend on snapshots.

Given you've done the legwork by making the individual stories I'm happy to merge this in to get your fix moving and we can use those in the updated docs when we migrate Menu KAIO (@kaizen/components) 👍

@mcwinter07 mcwinter07 merged commit e470f4a into main Oct 2, 2023
22 checks passed
@mcwinter07 mcwinter07 deleted the menu-max-height branch October 2, 2023 04:52
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.

2 participants