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

Conversation

@afc163
Copy link
Member

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
@pr-triage pr-triage bot added the PR: unreviewed label Sep 12, 2019
Copy link

left a comment

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

@netlify

This comment has been minimized.

Copy link

commented Sep 12, 2019

Deploy preview for ant-design ready!

Built with commit eb80734

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

@afc163 afc163 force-pushed the fix-search-clear branch from 338d3c1 to 624346b Sep 12, 2019
@shaodahong

This comment has been minimized.

Copy link
Collaborator

commented Sep 12, 2019

LGTM

@afc163 afc163 force-pushed the fix-search-clear branch from 624346b to 5b1690a Sep 12, 2019
close #18729
@afc163 afc163 force-pushed the fix-search-clear branch from 5b1690a to 4030f5a Sep 12, 2019
@codecov

This comment has been minimized.

Copy link

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} />);

This comment has been minimized.

Copy link
@shaodahong

shaodahong Sep 12, 2019

Collaborator

这个 onChange 没覆盖到

@afc163 afc163 merged commit 09810a2 into master Sep 13, 2019
29 of 31 checks passed
29 of 31 checks passed
Build
Details
Header rules - ant-design No header rules processed
Details
Pages changed - ant-design 215 new files uploaded
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
License Compliance All checks passed.
Details
Mixed content - ant-design No mixed content detected
Details
Redirect rules - ant-design 18 redirect rules processed
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
buildsize No change
Details
bundlesize Total bundle size is 582.65KB/600KB (-null)
Details
ci/circleci: check_metadata Your tests passed on CircleCI!
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 96.9%)
Details
codecov/project 96.91% (+<.01%) compared to 98dfd2a
Details
netlify/ant-design/deploy-preview Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected
@afc163 afc163 deleted the fix-search-clear branch Sep 13, 2019
@pr-triage pr-triage bot added PR: merged and removed PR: unreviewed labels Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.