Tencent / Tencent/tdesign-react

[Cascader] filter 添加 debounce 无效, Selector 和 Cascader 默认 filterable 大小写敏感策略不一致

Open
#2,709 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

💭 discussion
Dominant language
TypeScript
Stars
965
Forks
373
Avg merge
3d 6h
Merged PRs (30d)
17

Description

tdesign-react 版本

1.4.3

重现链接

https://stackblitz.com/edit/react-2k2pce?file=src%2Fdemo.jsx,package.json

重现步骤

链接中:
case 1 & case 2: selector 默认 filterable 大小写不敏感,cascader 默认 filterable 大小写敏感,未统一
case 3:自定义filter,得到了预期的筛选结果,但是没有高亮显示筛选结果项
case 4:试图优化性能,添加防抖函数,filter 结果失效

filter 回调函数中打 log,发现 filter 会针对每一条数据进行调用,如果有大量数据(如几千个),该回调函数会再每次输入变化时,都调用数次(几千次),感觉这里缺乏性能考量

期望结果
  • 统一 selector 和 cascader 的 filterable 的大小写敏感与否的行为
  • 优化 filter 调用策略,支持 debounce,可否再输入最后一次,针对现有数据调用一次 filter,而不是每输入一次都立马调用多次
实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

对组件提供 options 时,做筛选时的性能考量

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction, especially src/demo.jsx and package.json, and compare the Selector and Cascader behavior in cases 1–4. Investigate the filter callback behavior for custom filtering, highlighting, case sensitivity, and debounce with large option sets; done means the documented expected behaviors are consistent and filtering remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.