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

[Cascader][TreeSelect]支持展开面板已选项居中 #2092

Open
YyumeiZhang opened this issue Feb 23, 2024 · 2 comments
Open

[Cascader][TreeSelect]支持展开面板已选项居中 #2092

YyumeiZhang opened this issue Feb 23, 2024 · 2 comments
Assignees
Labels
feature request Request new feature PR Welcome Welcome pull request :)

Comments

@YyumeiZhang
Copy link
Collaborator

Which Component Need Enhancement 期望新增功能的组件

  • Cascader、TreeSelect

What does the proposed API look like 期望支持的API

Feature Description 功能描述

支持展开面板已选项居中

Additional information 补充说明

@YyumeiZhang YyumeiZhang added feature request Request new feature PR Welcome Welcome pull request :) labels Feb 23, 2024
@YyumeiZhang YyumeiZhang self-assigned this Feb 23, 2024
@l123wx
Copy link
Contributor

l123wx commented May 21, 2024

Hello,是指开启虚拟滚动时,选中选项后再次打开选项列表时将所选项垂直居中吗

image

image

@YyumeiZhang
Copy link
Collaborator Author

@l123wx 目前仅 TreeSelect 在选项展示情况下支持了虚拟化,Cascader 的虚拟化仅在搜索状态中,因此和此需求无关。

对于单选的 TreeSelect,无论启用虚拟化/未启用虚拟化,在面板打开时候,如果面板中有已选择项目,则打开面板时候,将滚动到已选项目。

对于单选的 Cascader, 在面板打开时候,如果面板中有已选择项目,则打开面板时候,将滚动到以选择项目。

为什么仅处理单选,不处理多选呢?
TreeSelect, Cascader 是支持收起展开的, 通常来将讲,如果有多个选择项目的话,应该滚动到第一个选择项目,但是如果第一个选择项目是收起状态,则需要滚动到其他项目,具体的滚动行为受到展开收起的影响,比较复杂,不确定用户具体的需要。因此不做处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request new feature PR Welcome Welcome pull request :)
Projects
None yet
Development

No branches or pull requests

2 participants