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

Make the menu scrollable #4837

Closed
SebastianStehle opened this issue Mar 4, 2020 · 6 comments · Fixed by #5155
Closed

Make the menu scrollable #4837

SebastianStehle opened this issue Mar 4, 2020 · 6 comments · Fixed by #5155
Assignees
Milestone

Comments

@SebastianStehle
Copy link

What problem does this feature solve?

Hi, I am evaluating ng-zorro and it looks awesome, but i have a few menus with a lot of items. Is there a way to make them scrollable?

What does the proposed API look like?

There is no need a for an API change

Example screen with shows the issue:

image

@vthinkxie
Copy link
Member

vthinkxie commented Mar 4, 2020

try add a classname to the ul, it should work

@SebastianStehle
Copy link
Author

What do you mean with classname? Any classname?

@SebastianStehle
Copy link
Author

I have already tried this:



.submenu {
    overflow-y: auto;
    background: red;
}

(therefore the red color)

@vthinkxie
Copy link
Member

overflow needs to work with at least a height value
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow

@SebastianStehle
Copy link
Author

I know, but I do not want to give the menu a fixed height, because I do not know the offset from the top nor the height the of the window.

Therefore the feature request to solve it with inside the component. The component should calculate if it overflows the window and then set the height accordingly and add overflow-y: auto or so.

@vthinkxie vthinkxie reopened this Mar 4, 2020
@vthinkxie vthinkxie modified the milestones: v9, 9.0.0 Mar 4, 2020
@vthinkxie vthinkxie self-assigned this Mar 4, 2020
@vthinkxie vthinkxie modified the milestones: 9.0.0, 9.1.0 Apr 15, 2020
vthinkxie pushed a commit to vthinkxie/ng-zorro-antd that referenced this issue Apr 26, 2020
vthinkxie pushed a commit to vthinkxie/ng-zorro-antd that referenced this issue Apr 26, 2020
vthinkxie pushed a commit that referenced this issue Apr 26, 2020
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
@ahmdelgmil
Copy link

ahmdelgmil commented Aug 7, 2024

Remove/Comment height in this classes .inner-content , .app-layout inside \src\app\app.component.css

.app-layout {
/* height: 100vh; */
}

.inner-content {
padding: 24px;
background: #fff;
/* height: 100%; */
}

or if you want to scroll in inner-content div
add overflow-y: scroll; in class inner-content
.inner-content {
padding: 24px;
background: #fff;
height: 100%;
overflow-y: scroll;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants