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: select search position #2298

Merged
merged 8 commits into from
Jun 18, 2024
Merged

feat: select search position #2298

merged 8 commits into from
Jun 18, 2024

Conversation

pointhalo
Copy link
Collaborator

@pointhalo pointhalo commented Jun 14, 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

Select 支持 searchPosition 配置,提供类似 TreeSelect 中的交互,将搜索框至于下拉列表中
image

image

  • 需要考虑的改动
    • ✅若同时设置了 topSlot

      • searchPosition 应该在 topSlot 下方,保持 topSlot 最高
    • ✅disabled时

      • 假设 defaultOpen + disabled,内部的input 应该也是禁用的
    • ✅ 键盘事件,在searchPosition 为dropdown时。键盘事件需要加在 Input 上?

      • 搜索时,按下回车键,需要选中当前高亮项
      • 上下需要能切换高亮项
    • ✅showClear=true 时,点击输入框的清空按钮,将同时清空 inputValue 和 value。需要在文档中说明

    • ✅ 多选

      • 多选情况下,选中后是否 input 重置
        • 这里不需要对齐 TreeSelect。对齐 普通 Select 多选现状:重置
        • 受已有 api autoClearSearchValue 控制 (与triggerInput一样,同样读取 this.state.inputVal 即可)

Changelog

🇨🇳 Chinese

  • Feat: Select 支持 searchPosition 配置

🇺🇸 English

  • Feat: Select add api searchPosition

Checklist

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

Other

  • Skip Changelog

Additional information

@pointhalo pointhalo changed the base branch from main to release June 14, 2024 08:00
Copy link

codesandbox-ci bot commented Jun 14, 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 8cade7d:

Sandbox Source
pr-story Configuration

@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 80 lines in your changes missing coverage. Please review.

Project coverage is 87.96%. Comparing base (68aeee3) to head (fdac83e).
Report is 27 commits behind head on release.

Current head fdac83e differs from pull request most recent head 46715ad

Please upload reports for the commit 46715ad to get more accurate results.

Files Patch % Lines
packages/semi-foundation/select/foundation.ts 8.57% 32 Missing ⚠️
packages/semi-foundation/form/foundation.ts 4.34% 22 Missing ⚠️
packages/semi-ui/select/index.tsx 50.00% 14 Missing ⚠️
packages/semi-ui/form/baseForm.tsx 0.00% 6 Missing ⚠️
packages/semi-ui/avatar/index.tsx 58.33% 5 Missing ⚠️
packages/semi-foundation/treeSelect/foundation.ts 75.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           release    #2298      +/-   ##
===========================================
- Coverage    88.25%   87.96%   -0.29%     
===========================================
  Files          441      441              
  Lines        26072    26151      +79     
  Branches      6659     6686      +27     
===========================================
- Hits         23010    23004       -6     
- Misses        3062     3147      +85     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cypress bot commented Jun 14, 2024

Passing run #2579 ↗︎

0 261 10 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge ece4443 into fb35172...
Project: semi-design Commit: 39099a393f ℹ️
Status: Passed Duration: 10:51 💡
Started: Jun 18, 2024 6:24 AM Ended: Jun 18, 2024 6:34 AM

Review all test suite changes for PR #2298 ↗︎

@linpan
Copy link

linpan commented Jun 14, 2024

Dropdown search

@pointhalo pointhalo requested a review from YannLynn June 18, 2024 06:15
@pointhalo pointhalo changed the title feat: select search position (WIP) feat: select search position Jun 18, 2024
@pointhalo pointhalo merged commit b99504c into release Jun 18, 2024
7 of 8 checks passed
@pointhalo pointhalo deleted the feat-selectSearchPosition branch June 18, 2024 10:25
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.

4 participants