Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
187
rated 0 times [  192] [ 5]  / answers: 1 / hits: 6734  / 4 Years ago, mon, august 10, 2020, 12:00:00

I am looking for scroll if data longer than 10,


<Dropdown overlay={menu}>
<a className="ant-dropdown-link" onClick={(e) => e.preventDefault()}>
Hover me <DownOutlined />
</a>
</Dropdown>

https://codesandbox.io/s/agitated-star-m7rhf?file=/index.js


This where I am trying to achieve the scroll but not sure how to make it work..
can anyone help me with this.


More From » reactjs

 Answers
16

I think you can do this with CSS like;


.ant-dropdown-menu {
max-height: 250px;
overflow: auto;
}

but this one doesn't check item count. If you want to check item count, you can do this with styled-components module.


[#2936] Thursday, August 6, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
calicinthias

Total Points: 447
Total Questions: 101
Total Answers: 118

Location: Botswana
Member since Sat, Dec 31, 2022
1 Year ago
calicinthias questions
Sun, Jan 2, 22, 00:00, 2 Years ago
Wed, Jan 13, 21, 00:00, 3 Years ago
Fri, May 15, 20, 00:00, 4 Years ago
;