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: Search crash in AutoComplete #25049

Merged
merged 1 commit into from
Jun 17, 2020
Merged

fix: Search crash in AutoComplete #25049

merged 1 commit into from
Jun 17, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jun 17, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

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

🔗 Related issue link

fix #25031

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Input.Search as AutoComplete customize component crash issue.
🇨🇳 Chinese 修复 Input.Search 作为 AutoComplete 自定义组件会崩溃的问题。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 17, 2020

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 17, 2020

@@ -46,7 +47,7 @@ const Search = React.forwardRef<unknown, SearchProps>((props, ref) => {
return;
}
if (customOnSearch) {
customOnSearch(inputRef.current.input.value, e);
customOnSearch(inputRef.current?.input.value!, e);
Copy link
Member

Choose a reason for hiding this comment

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

? 和 ! 感觉是矛盾的。

Copy link
Member Author

Choose a reason for hiding this comment

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

第一个一个是判断是否有 instance。第二个是有了 instance 一定会有 value。

@codesandbox-ci
Copy link

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 2dc3b70:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #25049 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #25049   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files         365      365           
  Lines        7294     7294           
  Branches     1990     2039   +49     
=======================================
  Hits         7249     7249           
  Misses         45       45           
Impacted Files Coverage Δ
components/input/Search.tsx 100.00% <100.00%> (ø)

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 8dc1603...2dc3b70. Read the comment docs.

@zombieJ zombieJ merged commit dc4b420 into master Jun 17, 2020
@zombieJ zombieJ deleted the fix-search branch June 17, 2020 05:35
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.

Search in AutoComplete throw exceptions
3 participants