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

Prevent Input.Search component to throw passing null as enterButton prop value #27591

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

davidebianchi
Copy link
Contributor

[中文版模板 / 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
  • Other (about what?)

🔗 Related issue link

No open issue

💡 Background and solution

The type of enterButton property is ReactNode, which accept the null value. In the code, it is performed a enterButton.type operation, resulting in a js error. With the default value, false, it is not an error because false.type === undefined.

📝 Changelog

It is possible to pass null as enterButton value without throw.

Language Changelog
🇺🇸 English
🇨🇳 Chinese x

☑️ 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 Nov 5, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 5, 2020

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 19d6a22:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Nov 5, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master    #27591   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          390       390           
  Lines         7415      7415           
  Branches      2083      2084    +1     
=========================================
  Hits          7415      7415           
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 3e62e85...19d6a22. Read the comment docs.

@afc163 afc163 merged commit 72dbcfc into ant-design:master Nov 6, 2020
@afc163 afc163 mentioned this pull request Nov 8, 2020
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.

3 participants