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

Feat: support grouped Options in Virtualized Select #2643 #2645

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Shabi-x
Copy link
Contributor

@Shabi-x Shabi-x commented Dec 24, 2024

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

阅读了相关源码我认为问题本质是虚拟滚动和分组渲染的实现方式不兼容,我尝试修改了虚拟列表渲染的逻辑,增加了对于分组情况的支持。

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Dec 24, 2024

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:

Sandbox Source
pr-story Configuration

@Shabi-x
Copy link
Contributor Author

Shabi-x commented Jan 15, 2025

@YyumeiZhang 您好,可以麻烦看看这个pr嘛,如果有需要改进的地方可以指点下嘛


content.push(option);
});

return (
<List
ref={this.virtualizeListRef}
height={height || numbers.LIST_HEIGHT}
itemCount={visibleOptions.length}
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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会更准确一些,已更改

@YyumeiZhang
Copy link
Collaborator

@pointhalo
image

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

Successfully merging this pull request may close these issues.

2 participants