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

Select组件中listItemHeight默认值为24 文档中却说默认值为32;导致下拉回显无法出现在第一屏 #38228

Closed
JokerAn opened this issue Oct 26, 2022 · 1 comment

Comments

@JokerAn
Copy link

JokerAn commented Oct 26, 2022

Reproduction link

https://gitee.com/ant-design/ant-design/commit/3ca11e94ce95cf40cc63f7d3356d97af55c55312

Steps to reproduce

在size='middle'也就是默认情况下;如果下拉选项比较多,并且已经有选中的值后(选中的值比较靠下需要滚动才能看到);
这时候点开下拉框 默认第一屏看不到回显值;但是点击过一次后就会正确;设置listItemHeight={32} 就不会出现这个问题;
文档标注,默认为32 实际代码仓库中已于2020年6月3日更改为了24;但是文档说明中并未改;仍提示用户默认为32

What is expected?

select组件在size='middle'也就是默认情况下;
点击下拉框展开后第一屏可以看到之前已经选中的item

What is actually happening?

需要自己再次向下滚动一定距离才会看到之前选中过的item

Environment Info
antd 4.23.6
React react18
System mac
Browser chrome106

文档说明为 https://ant-design.antgroup.com/components/select-cn/#API 全局搜索 "自定义 Option 样式导致滚动异常怎么办?"

#24706 之前listItemHeight都为32 但是#24706 改为了listItemHeight=24
改动commitid : https://gitee.com/ant-design/ant-design/commit/3ca11e94ce95cf40cc63f7d3356d97af55c55312

@zombieJ
Copy link
Member

zombieJ commented Oct 26, 2022

感谢反馈,我更新一下。

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

No branches or pull requests

2 participants