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

Contextual menu scrolling #961

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

huwshimi
Copy link
Collaborator

Done

QA

  • Open src/components/ContextualMenu/ContextualMenu.stories.mdx.
  • Scroll down to the "Toggle" story and duplicate the links objects so that there are quite a few links.
  • add scrollOverflow: true, to the args.
  • Run Storybook (yarn start).
  • Open <storybook-url>/iframe.html?id=contextualmenu--toggle&viewMode=story
  • Click on the button to open the menu.
  • Resize your window so that the menu doesn't fit on the screen.
  • The menu should resize so that it doesn't get cut off, and the content should scroll.

Screenshots

Screenshot 2023-08-29 at 12 31 09 pm

@webteam-app
Copy link

Demo starting at https://react-components-961.demos.haus

Copy link
Contributor

@vladimir-cucu vladimir-cucu left a 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! 🙂

@bartaz
Copy link
Contributor

bartaz commented Aug 29, 2023

I don't mind having it directly implemented in React components, but seems like it would be good to ensure it's well supported from Vanilla perspective.

Currently Vanilla doesn't directly support this, and while adding max-height and overflow-x from React works now, without official Vanilla support we can't ensure it will not break at some point if changes are made to contextual menu.

I guess we could at least add an example in Vanilla with such use case (and max-height/overflow added) to make sure we don't break it by regression. Or maybe overflow-x could be set to auto by default, in CSS (I'm not sure if it would break something when it's not needed).

@huwshimi
Copy link
Collaborator Author

I don't mind having it directly implemented in React components, but seems like it would be good to ensure it's well supported from Vanilla perspective.

If we do decide to support this in Vanilla, we should also address the other dropdowns, like the one for the search and filter pattern, as we also had to fix that one recently as well: #906.

@huwshimi
Copy link
Collaborator Author

I don't mind having it directly implemented in React components, but seems like it would be good to ensure it's well supported from Vanilla perspective.

Currently Vanilla doesn't directly support this, and while adding max-height and overflow-x from React works now, without official Vanilla support we can't ensure it will not break at some point if changes are made to contextual menu.

I guess we could at least add an example in Vanilla with such use case (and max-height/overflow added) to make sure we don't break it by regression. Or maybe overflow-x could be set to auto by default, in CSS (I'm not sure if it would break something when it's not needed).

I've filed in issue so that we can follow up on this: canonical/vanilla-framework#4864.

@huwshimi huwshimi merged commit b69aeef into canonical:main Aug 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants