-
Notifications
You must be signed in to change notification settings - Fork 732
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
Feat: support grouped Options in Virtualized Select #2643 #2645
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 453ee0b:
|
@YyumeiZhang 您好,可以麻烦看看这个pr嘛,如果有需要改进的地方可以指点下嘛 |
packages/semi-ui/select/index.tsx
Outdated
|
||
content.push(option); | ||
}); | ||
|
||
return ( | ||
<List | ||
ref={this.virtualizeListRef} | ||
height={height || numbers.LIST_HEIGHT} | ||
itemCount={visibleOptions.length} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemCount={visibleOptions.length} 应该修改为content 的 size ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemCount={visibleOptions.length} 应该修改为content 的 size ?
感谢回复,在有分组标题头的情况下这两者确实有差别,渲染的高度有差异,用content.length会更准确一些,已更改
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
阅读了相关源码我认为问题本质是虚拟滚动和分组渲染的实现方式不兼容,我尝试修改了虚拟列表渲染的逻辑,增加了对于分组情况的支持。
Checklist
Other
Additional information