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

fix: Input.Search should trigger onSearch when clear #18783

Merged
merged 2 commits into from Sep 13, 2019
Merged

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Sep 12, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #18729

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Input.Search not trigger onSearch when click clear icon.
🇨🇳 Chinese 修复 Input.Search 点击清除图标时没有触发 onSearch 的问题。

☑️ Self Check before Merge

  • 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

Copy link

@tests-checker tests-checker bot left a comment

Could you please add tests to make sure this change works as expected?

@netlify
Copy link

netlify bot commented Sep 12, 2019

Deploy preview for ant-design ready!

Built with commit eb80734

https://deploy-preview-18783--ant-design.netlify.com

@shaodahong
Copy link
Member

shaodahong commented Sep 12, 2019

LGTM

@codecov
Copy link

codecov bot commented Sep 12, 2019

Codecov Report

Merging #18783 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18783      +/-   ##
==========================================
+ Coverage    96.9%   96.91%   +<.01%     
==========================================
  Files         281      281              
  Lines        7540     7546       +6     
  Branches     2100     2091       -9     
==========================================
+ Hits         7307     7313       +6     
  Misses        231      231              
  Partials        2        2
Impacted Files Coverage Δ
components/input/Search.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98dfd2a...eb80734. Read the comment docs.

// https://github.com/ant-design/ant-design/issues/18729
it('should trigger onSearch when click clear icon', () => {
const onSearch = jest.fn();
const wrapper = mount(<Search allowClear defaultValue="value" onSearch={onSearch} />);
Copy link
Member

@shaodahong shaodahong Sep 12, 2019

Choose a reason for hiding this comment

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

这个 onChange 没覆盖到

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