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(#16762): should use cachedOptions when filtered options don't cange #22216

Merged
merged 1 commit into from
Mar 19, 2020
Merged

fix(#16762): should use cachedOptions when filtered options don't cange #22216

merged 1 commit into from
Mar 19, 2020

Conversation

kerm1it
Copy link
Member

@kerm1it kerm1it commented Mar 14, 2020

🤔 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 #16762

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Cascader search need to press down arrow twice to select item(#16762)
🇨🇳 Chinese 修复 Cascader 搜索时需要按两次向下箭头才能选中问题(#16762)

☑️ 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

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

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

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

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Mar 14, 2020

@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 4bbd7b0:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Mar 14, 2020

Codecov Report

Merging #22216 into master will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22216      +/-   ##
==========================================
+ Coverage   97.92%   97.95%   +0.02%     
==========================================
  Files         306      306              
  Lines        7042     7044       +2     
  Branches     1928     1939      +11     
==========================================
+ Hits         6896     6900       +4     
+ Misses        146      144       -2
Impacted Files Coverage Δ
components/cascader/index.tsx 97.2% <50%> (-0.45%) ⬇️
components/carousel/index.tsx 100% <0%> (+6.52%) ⬆️

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 6f4d279...4bbd7b0. Read the comment docs.

@kerm1it
Copy link
Member Author

kerm1it commented Mar 14, 2020

The problem is that the search options always generates new, even when the options has not changed, causing component always re-render.

@afc163
Copy link
Member

afc163 commented Mar 15, 2020

image

Could you fill text cov?

@kerm1it
Copy link
Member Author

kerm1it commented Mar 15, 2020

image

Could you fill text cov?

Sorry, I don't know how to do it.

@kerm1it
Copy link
Member Author

kerm1it commented Mar 18, 2020

In progress?

@afc163
Copy link
Member

afc163 commented Mar 19, 2020

@kerm1it
Copy link
Member Author

kerm1it commented Mar 19, 2020

codecov.io/gh/ant-design/ant-design/pull/22216/diff?src=pr&el=tree#diff-Y29tcG9uZW50cy9jYXNjYWRlci9pbmRleC50c3g=

This line is not be covered.

I try it in my local, this line is be covered.

WX20200319-134111@2x

@afc163
Copy link
Member

afc163 commented Mar 19, 2020

Could you fill the changelog part in which we should tell our users?

image

@kerm1it
Copy link
Member Author

kerm1it commented Mar 19, 2020

Could you fill the changelog part in which we should tell our users?

image

Done.

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.

Cascader: User has to press down arrow key twice to select the first option while searching
4 participants