You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To see the last option, we will have to scroll, although it is scrollable, the scrollbar is not visible.
Or, Implement a custom list item, if the height of each list item is large enough, say 50px, overflow occurs on 4-5 options, but the scrollbar is not visible until there are more than 10 options.
What is expected?
Scrollbar should be visible on overflow, regardless of the number of options available.
What is actually happening?
Scrollbar is not visible unless there are more than 10 options.
Environment
Info
antd
4.24.9
React
17.x
System
Windows 11
Browser
Chrome version 121.0.6167.140
For custom list item implementation, it looks like the issue is due to not passing the optional listItemHeight, as the default values are passed and rc-virtual-list is determining whether or not to show the scrollbar with one of the conditions being itemHeight * data.length > height (https://github.com/react-component/virtual-list/blob/master/src/List.tsx)
The prop listItemHeight can be made mandatory when a custom list item is implemented, i.e., children is passed.
Regarding, the regular select option, I think the above condition is returning false (itemHeight * data.length > height) default values of itemHeight being 20 and height being 200.
The text was updated successfully, but these errors were encountered:
Reproduction link
https://stackblitz.com/edit/react-mnyapj?file=demo.tsx
Steps to reproduce
<Select>
component with <=10 options.What is expected?
Scrollbar should be visible on overflow, regardless of the number of options available.
What is actually happening?
Scrollbar is not visible unless there are more than 10 options.
For custom list item implementation, it looks like the issue is due to not passing the optional
listItemHeight
, as the default values are passed andrc-virtual-list
is determining whether or not to show the scrollbar with one of the conditions beingitemHeight * data.length > height
(https://github.com/react-component/virtual-list/blob/master/src/List.tsx)The prop
listItemHeight
can be made mandatory when a custom list item is implemented, i.e.,children
is passed.Regarding, the regular select option, I think the above condition is returning false (
itemHeight * data.length > height
) default values ofitemHeight
being 20 andheight
being 200.The text was updated successfully, but these errors were encountered: