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 source in the onSearch handler of Input.Search Component when the value had changed #44457

Merged
merged 6 commits into from Aug 28, 2023

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Aug 28, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Support source in the onSearch handler of Input.Search Component when the value had changed
🇨🇳 Chinese Input.Search 组件支持在 onSearch 方法中接受 source 参数

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 9c5441a

This pull request enhances the Search component and its demo and tests by introducing a new source prop that indicates the trigger of the search action. This enables more flexibility and customization of the search behavior and user experience.

🔍 Walkthrough

🤖 Generated by Copilot at 9c5441a

  • Add a new source prop to the Search component to indicate the source of the search action (link)
  • Pass the source prop as 'clear' or 'input' to the customOnSearch function in Search.tsx depending on the user interaction (link, link)
  • Import the SearchProps type and use it to define the onSearch function in the demo file search-input.tsx (link, link)
  • Update the test cases in Search.test.tsx to expect the source prop as 'clear' or 'input' in different scenarios (link, link, link, link, link, link, link, link)

@stackblitz
Copy link

stackblitz bot commented Aug 28, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 390.74 KB (+17 B 🔺)
./dist/antd-with-locales.min.js 449.67 KB (+20 B 🔺)

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (e7c7601) 100.00% compared to head (ad62e71) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #44457   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          668       668           
  Lines        11325     11325           
  Branches      3062      3062           
=========================================
  Hits         11325     11325           
Files Changed Coverage Δ
components/input/Search.tsx 100.00% <100.00%> (ø)

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

components/input/Search.tsx Outdated Show resolved Hide resolved
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.

None yet

2 participants