Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Oct 13, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

Select:(历史相关 PR:#973 (comment))

Cascader

image

(右边为当前效果... Input 框的撑开高度交给用户自己设置 inputClass 更加自由,下拉框的选项高度,通过组件库主动给高度设为 auto 比较合理)

📝 更新日志

  • fix(Select): 修复 label 为非 string 类型时,开启 filterable 搜索后报错的问题

  • fix(Select): 修复使用 label / content / children 自定义元素时,下拉框选项的高度没有撑开的问题

  • fix(SelectInput): 修复 inputProps.inputClass 无法生效的问题

  • fix(SelectInput): 修复单选且 valueDisplay 为自定义元素时,开启 filterable 无法显示输入内容的问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 13, 2025

tdesign-react-demo

npm i https://pkg.pr.new/tdesign-react@3891

commit: 105862d

@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2025

完成

@RylanBot RylanBot added the WIP work in porgess label Oct 14, 2025
@RylanBot RylanBot force-pushed the rylan/feat/select/filterable branch from fc47b2a to 8ec8e7d Compare October 15, 2025 07:08
@RylanBot RylanBot removed the WIP work in porgess label Oct 15, 2025
@RylanBot RylanBot requested a review from Copilot October 15, 2025 10:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves label filtering functionality in the Select component and related components (SelectInput, Cascader, TreeSelect), fixing several issues with custom node rendering and input behavior.

Key Changes:

  • Fixed errors when filtering Select options with custom label nodes (ReactElements)
  • Fixed rendering issues for custom content in Select dropdown options
  • Improved single-selection input value display for SelectInput when labels are custom nodes
  • Fixed inputProps.inputClass not being applied correctly

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/components/select/base/Select.tsx Added extractTextFromTNode utility to enable filtering custom label nodes; fixed type annotations
packages/components/select/base/Option.tsx Added auto-height styling for custom element content; removed unreachable return statement
packages/components/select/_example/custom-options.tsx Refactored demo to show both slot-based and content attribute approaches for custom options
packages/components/select-input/useSingle.tsx Refactored single-select value display logic to properly render custom label nodes with absolute positioning
packages/components/_util/parseTNode.ts Added extractTextFromTNode utility function to recursively extract text from TNode structures
packages/components/tree-select/TreeSelect.tsx Simplified input value logic by removing redundant display handling code
test/snap/__snapshots__/ssr.test.jsx.snap Updated snapshots to reflect DOM structure changes
test/snap/__snapshots__/csr.test.jsx.snap Updated snapshots to reflect DOM structure changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RylanBot RylanBot force-pushed the rylan/feat/select/filterable branch from 9d1f8c9 to ba42885 Compare October 16, 2025 07:36
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