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鈥檒l 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

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

codesandbox-ci bot commented Mar 14, 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 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.

@afc163 afc163 merged commit e3b7c9a into ant-design:master Mar 19, 2020
14 of 16 checks passed
@kerm1it kerm1it deleted the fix-16762 branch Mar 19, 2020
@kerm1it kerm1it restored the fix-16762 branch Mar 19, 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.

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